interesting
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=0;
for i=1:n
if i==1
A(i+1)=0;
else
[C Chigh]=ismember(A(i),A(1:i-1));
if not(Chigh==0)
A(i+1)=i-Chigh;
else
A(i+1) = 0;
end
end
end
result = A(n);
end
Find all elements less than 0 or greater than 10 and replace them with NaN
11611 Solvers
First non-zero element in each column
463 Solvers
Create a Multiplication table matrix...
226 Solvers
Number of digits in an integer
271 Solvers
2126 Solvers