Return the Van Eck's Sequence's nth member.
For detailed info : OEIS link and here
seq = 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5...
First member is 0;
Second member is 0;
third member is 1 etc
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.
Return a list sorted by number of occurrences
find the maximum element of the matrix
sum of first 'n' terms
Length of a short side
Deleting an element in a matrix
Recaman Sequence - III
Net Present Value of a Stream of Cash Flows
Bridge and Torch Problem - Minimum time
Integer to boolean
Delete the rows in the middle
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