cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A215452 a(1)=1, a(n) = (sum of previous terms) mod (a(n-1) + n).

This page as a plain text file.
%I A215452 #21 Jun 16 2025 11:27:32
%S A215452 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,
%T A215452 54,21,32,4,29,42,14,10,44,57,44,63,6,5,10,52,23,32,44,64,74,71,33,18,
%U A215452 60,93,29,46,48,60,84,38,26,39,46,83,81,25,59,93,22,47,24,34,53
%N A215452 a(1)=1, a(n) = (sum of previous terms) mod (a(n-1) + n).
%C A215452 Indices of 0's: 7, 21, 956, 1576, 1964, 55346, 70460, 99845, 399114, 544095, 35321849, 77073660, ...
%C A215452 Indices of 1's: 1, 2, 129, 193, 262, 4495, 99781, 651856, 35351437, ...
%C A215452 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, ...
%H A215452 Alois P. Heinz, <a href="/A215452/b215452.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Harvey P. Dale)
%F A215452 a(1)=1, a(n) = (a(0)+...+a(n-1)) mod (a(n-1)+n).
%p A215452 s:= proc(n) option remember; `if`(n<1, 0, s(n-1)+a(n)) end:
%p A215452 a:= proc(n) option remember; `if`(n=1, 1, irem(s(n-1), a(n-1)+n)) end:
%p A215452 seq(a(n), n=1..74);  # _Alois P. Heinz_, Jun 16 2025
%t A215452 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 *)
%o A215452 (Python)
%o A215452 s = a = 1
%o A215452 for n in range(2,333):
%o A215452     print(a, end=", ")
%o A215452     a = s % (a+n)
%o A215452     s += a
%Y A215452 Cf. A094405, A066910, A215451.
%K A215452 nonn
%O A215452 1,3
%A A215452 _Alex Ratushnyak_, Aug 11 2012