Problem 44321. Van Eck's Sequence's nth member
I don't understand why in my Matlab software it works for all the x while here it falis for x>=11
function result = VanEcksSequence(n)
A(i+1) = 0;
result = A(n);
i dont think ur algorithm is correct. understand the sequence well..
The first term is zero. Then-
If the last term is *new* to the sequence so far then-- The next term is zero.
The next term is "how far back" this last term occured previousely.
Problem Recent Solvers315
Make a run-length companion vector
How many trades represent all the profit?
Try 1.5.4: Celsius to Fahrenheit
More from this Author92
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!