Use the method of common differences to output a vector containing the initial values and the nth order difference.
ex [ 1 4 9 16 25 36 ] has 1st differences [ 3 5 7 9 11 ] and second differences [2 2 2 2] . Therefore output [1 3 2] which is the 1st element of the above three vectors.
The use of this is that the sequence can be continued by using these differences.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers58
Suggested Problems
-
Return the 3n+1 sequence for n
8508 Solvers
-
21474 Solvers
-
Generate a string like abbcccddddeeeee
276 Solvers
-
Number of vertices of a hypercube
100 Solvers
-
5926 Solvers
More from this Author10
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!