I want to generate first 256 fibonacci sequence elments . the code is repeating a fixed number after some terms, I think that we can use maximum of uint 64 and if a number gets begger we just stuck or is there any other reason or mistake in the code.
clearformat long gn(1) =uint64(1);n(2) = 1;k = 3;while k <= 256 n(k) = [n(k-2) + n(k-1)]; k = k + 1;endff=mod(n,256);%fprintf('%g,',n)
what I m getting is
Columns 91 through 105 69 189 2 255 255 255 255 255 255 255 255 255 255 255 255 Columns 106 through 120 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 Columns 121 through 135
Best Answer