How to create an algorithm to solve this problem :
Let's say we have the number 1,9,25,49,81
the formula xn = (2n-1)^2
That is, if n is to put the number 1 we will have the results too 1 and if n is put 2 the results will be 9 .
How to make a mini algorithm who would be in the water of numbers deduced the formula suppose we have 2,4,8,16,32 and I displays that xn =
Puzzled for a second day.
novella_Hermiston36 answered on July 4th 19 at 23:15
What Is Lagrange ? What is interpolation ? It is the curriculum. But as correctly stated by colleagues, here we need to use neural network. Unfortunately they are not told what. I will say you need to use the network in your head, or the head of a neighbor.
P. S. bonus solution "... the number 1 ; -2 ; 3 ; -4 ; 5 ... " - formula: (-n)*(-1)^n
nicklaus answered on July 4th 19 at 23:17
Did something similar in the lab. Used genetic algorithms. But - directly for any set you won't get the exact formula. Especially depends on the allowed mathematical operators.
Jeanie_Torphy90 answered on July 4th 19 at 23:19
If it was possible, would have long since found the formula describing the pattern in a number of Prime numbers. But yet its such a formula.
Another thing is if you know which type of sequence, such as geometric, then the problem is reduced to the search (sorting) of the parameters of the function.