|
|
A215451
|
|
a(0)=1, a(n) = (sum of previous terms) mod (a(n-1)+n).
|
|
2
|
|
|
1, 1, 2, 4, 0, 3, 2, 4, 5, 8, 12, 19, 30, 5, 1, 1, 13, 21, 15, 11, 3, 17, 22, 20, 0, 20, 10, 28, 54, 0, 2, 4, 14, 23, 33, 0, 12, 28, 52, 45, 35, 48, 88, 61, 42, 36, 35, 70, 16, 1, 8, 41, 3, 21, 0, 5, 18, 23, 43, 17, 1, 41, 65, 111, 149, 25, 1, 53, 29, 63, 98, 102, 154, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Indices of 0's: 4, 24, 29, 35, 54, 267, 5284, 17827, 43631, 120871, 843813, 1854903, 2226536, 4208775, 5525594, ...
Indices of 1's: 0, 1, 14, 15, 49, 60, 66, 116, 331, 6053, 23760, 288502, 496670, 4281666, ...
Indices such that a(n)=n: 1, 2, 22, 315, 1172, 1441, 1846, 2140, 47376, 593870, 16538298, 111824649, 565597433, 791186876, ...
|
|
LINKS
|
|
|
FORMULA
|
a(0)=1, a(n) = (a(0)+...+a(n-1)) mod (a(n-1)+n).
|
|
MATHEMATICA
|
nxt[{n_, t_, a_}]:=Module[{c=Mod[t, a+n+1]}, {n+1, t+c, c}]; NestList[nxt, {0, 1, 1}, 80][[All, 3]] (* Harvey P. Dale, Dec 30 2017 *)
|
|
PROG
|
(Python)
sum = a = 1
for n in range(1, 333):
print a,
a = sum % (a+n)
sum += a
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|