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).

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Aug 11 2012

Keywords

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, ...

Crossrefs

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).