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.
Determine whether a vector is monotonically increasing
Given two strings, find the maximum overlap
Change the sign of even index entries of the reversed vector
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
Hexagonal numbers on a spiral matrix
Find a real root of a quintic function without using roots function
Calculate F statistics ( One-way Analysis of Variance)
Bridge and Torch Problem - Length of Unique Time List
Find a real root of a quintic function
Integer to boolean
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office