login
A215452
a(1)=1, a(n) = (sum of previous terms) mod (a(n-1)+n).
2
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,3
COMMENTS
Indices of 0's: 7, 21, 956, 1576, 1964, 55346, 70460, 99845, 399114, 544095, 35321849, 77073660, ...
Indices of 1's: 1, 2, 129, 193, 262, 4495, 99781, 651856, 35351437, ...
Indices such that a(n)=n: 1, 4, 9, 10, 32, 176, 266, 414, 432, 440, 858, 5953, 6030, 15146, 1408096, 3138130, 35659404, 44722350, 109021513, 790542727, ...
LINKS
FORMULA
a(1)=1, a(n) = (a(0)+...+a(n-1)) mod (a(n-1)+n).
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 *)
PROG
(Python)
sum = a = 1
for n in range(2, 333):
print a,
a = sum % (a+n)
sum += a
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Aug 11 2012
STATUS
approved