%I #10 Dec 30 2017 19:57:40
%S 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,
%T 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,
%U 21,0,5,18,23,43,17,1,41,65,111,149,25,1,53,29,63,98,102,154,5
%N a(0)=1, a(n) = (sum of previous terms) mod (a(n-1)+n).
%C Indices of 0's: 4, 24, 29, 35, 54, 267, 5284, 17827, 43631, 120871, 843813, 1854903, 2226536, 4208775, 5525594, ...
%C Indices of 1's: 0, 1, 14, 15, 49, 60, 66, 116, 331, 6053, 23760, 288502, 496670, 4281666, ...
%C Indices such that a(n)=n: 1, 2, 22, 315, 1172, 1441, 1846, 2140, 47376, 593870, 16538298, 111824649, 565597433, 791186876, ...
%H Harvey P. Dale, <a href="/A215451/b215451.txt">Table of n, a(n) for n = 0..1000</a>
%F a(0)=1, a(n) = (a(0)+...+a(n-1)) mod (a(n-1)+n).
%t 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 *)
%o (Python)
%o sum = a = 1
%o for n in range(1,333):
%o print a,
%o a = sum % (a+n)
%o sum += a
%Y Cf. A094405, A066910, A215452.
%K nonn
%O 0,3
%A _Alex Ratushnyak_, Aug 11 2012
|