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
Given an unsigned integer x, find the largest y by rearranging the bits in x
Who is the smartest MATLAB programmer?
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
More from this Author92
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!