OFFSET
0,3
LINKS
Samuel B. Reid, Table of n, a(n) for n = 0..10000
EXAMPLE
a(1) = 1 + a(0 mod 1) = 1.
a(2) = 2 + a((0+1) mod 2) = 3.
a(3) = 3 + a((0+1+3) mod 3) = 4.
a(4) = 4 + a((0+1+3+4) mod 4) = 4.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = n + a[Mod[Sum[a[k], {k, 0, n-1}], n]]; Array[a, 100, 0] (* Amiram Eldar, Dec 07 2019 *)
PROG
(PARI) lista(nn) = {my(v=vector(nn+1), s=0); v[1]=0; for(n=1, nn, v[n+1]=n+v[s%n+1]; s+=v[n+1]); v; } \\ Jinyuan Wang, Dec 07 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Samuel B. Reid, Dec 06 2019
STATUS
approved