login
a(1) = 0; a(2) = 1; a(n) = (a(n-1) + a(n-2)) mod n.
4

%I #9 Mar 20 2018 14:06:03

%S 0,1,1,2,3,5,1,6,7,3,10,1,11,12,8,4,12,16,9,5,14,19,10,5,15,20,8,0,8,

%T 8,16,24,7,31,3,34,0,34,34,28,21,7,28,35,18,7,25,32,8,40,48,36,31,13,

%U 44,1,45,46,32,18,50,6,56,62,53,49,35,16,51,67,47,42,16,58,74,56,53,31,5,36

%N a(1) = 0; a(2) = 1; a(n) = (a(n-1) + a(n-2)) mod n.

%H Robert Israel, <a href="/A096534/b096534.txt">Table of n, a(n) for n = 1..10000</a>

%p N:= 100: # to get a(1)..a(N)

%p A:= Vector(N):

%p A[1]:= 0: A[2]:= 1:

%p for n from 3 to N do

%p A[n]:= A[n-1] + A[n-2] mod n

%p od:

%p convert(A,list); # _Robert Israel_, Nov 13 2017

%t l = {0, 1}; For[i = 3, i <= 100, i++, len = Length[l]; l = Append[l, Mod[l[[len]] + l[[len - 1]], i]]]; l

%Y Cf. A079777, A096535.

%Y A072987 is a closely related sequence.

%K easy,nonn

%O 1,4

%A _Franklin T. Adams-Watters_, Jun 23 2004