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
Return unique values without sorting
Return a list sorted by number of consecutive occurrences
More from this Author92
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!