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.

A330249 a(0) = 0; for n > 0, a(n) = n + a((Sum_{k=0..n-1} a(k)) mod n).

Original entry on oeis.org

0, 1, 3, 4, 4, 8, 9, 8, 16, 25, 26, 19, 16, 38, 39, 24, 16, 18, 22, 38, 59, 45, 81, 61, 28, 41, 67, 66, 95, 37, 69, 112, 40, 71, 50, 147, 183, 77, 75, 120, 62, 91, 119, 104, 94, 116, 55, 63, 70, 196, 145, 75, 92, 91, 170, 110, 176, 177, 241, 109
Offset: 0

Views

Author

Samuel B. Reid, Dec 06 2019

Keywords

Examples

			a(1) = 1 + a(0 mod 1) = 1.
a(2) = 2 + a((0+1) mod 2) = 3.
a(3) = 3 + a((0+1+3) mod 3) = 4.
a(4) = 4 + a((0+1+3+4) mod 4) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = n + a[Mod[Sum[a[k], {k, 0, n-1}], n]]; Array[a, 100, 0] (* Amiram Eldar, Dec 07 2019 *)
  • PARI
    lista(nn) = {my(v=vector(nn+1), s=0); v[1]=0; for(n=1, nn, v[n+1]=n+v[s%n+1]; s+=v[n+1]); v; } \\ Jinyuan Wang, Dec 07 2019