A215452 a(1)=1, a(n) = (sum of previous terms) mod (a(n-1) + n).
1, 1, 2, 4, 8, 2, 0, 2, 9, 10, 18, 27, 4, 16, 11, 7, 2, 4, 13, 9, 0, 18, 4, 4, 2, 10, 3, 5, 26, 54, 21, 32, 4, 29, 42, 14, 10, 44, 57, 44, 63, 6, 5, 10, 52, 23, 32, 44, 64, 74, 71, 33, 18, 60, 93, 29, 46, 48, 60, 84, 38, 26, 39, 46, 83, 81, 25, 59, 93, 22, 47, 24, 34, 53
Offset: 1
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harvey P. Dale)
Programs
-
Maple
s:= proc(n) option remember; `if`(n<1, 0, s(n-1)+a(n)) end: a:= proc(n) option remember; `if`(n=1, 1, irem(s(n-1), a(n-1)+n)) end: seq(a(n), n=1..74); # Alois P. Heinz, Jun 16 2025
-
Mathematica
nxt[{t_,n_,a_}]:={t+a,n+1,Mod[t+a,a+n+1]}; NestList[nxt,{0,1,1},80][[All,3]] (* Harvey P. Dale, Sep 01 2016 *)
-
Python
s = a = 1 for n in range(2,333): print(a, end=", ") a = s % (a+n) s += a
Formula
a(1)=1, a(n) = (a(0)+...+a(n-1)) mod (a(n-1)+n).
Comments