login
a(1) = 2; for n > 1, a(n) = (a(n-1) + n) mod prime(n).
3

%I #11 Jul 19 2023 13:24:07

%S 2,1,4,1,6,12,2,10,19,0,11,23,36,7,22,38,55,12,31,51,72,15,38,62,87,

%T 12,39,67,96,13,44,76,109,4,39,75,112,150,22,62,103,145,188,39,84,130,

%U 177,2,51,101,152,204,16,70,125,181,238,25,84,144,205,267,23,87,152,218,285

%N a(1) = 2; for n > 1, a(n) = (a(n-1) + n) mod prime(n).

%H Harvey P. Dale, <a href="/A088522/b088522.txt">Table of n, a(n) for n = 1..1000</a>

%t a[1] = 2; a[n_] := a[n] = Mod[a[n - 1] + n, Prime[n]]; Table[ a[n], {n, 67}]

%t nxt[{n_,a_}]:={n+1,Mod[a+n+1,Prime[n+1]]}; NestList[nxt,{1,2},70][[;;,2]] (* _Harvey P. Dale_, Jul 19 2023 *)

%Y Cf. A088521, A088523, A006257.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_, Nov 14 2003

%E More terms from _Robert G. Wilson v_ and _Ray Chandler_, Nov 15 2003