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.

A346972 a(1)=1, a(2)=4, a(n) = (n*a(n-1) - (n-1)*a(n-2)) mod (n+1).

Original entry on oeis.org

1, 4, 2, 1, 3, 6, 0, 3, 7, 10, 4, 3, 5, 1, 9, 10, 8, 12, 4, 20, 10, 7, 13, 1, 25, 4, 18, 19, 17, 21, 13, 29, 31, 27, 35, 19, 13, 25, 1, 8, 36, 23, 5, 41, 15, 20, 10, 30, 40, 20, 8, 32, 38, 26, 50, 2, 40, 23, 57, 50, 2, 35, 33, 37, 29, 45, 13, 8, 18, 69, 39, 26
Offset: 1

Views

Author

Steven M. Altschuld, Aug 09 2021

Keywords

Comments

Goes as high as 2917 before settling to a final value of 77 for all n >= 2982.

Programs

  • Mathematica
    a[1] = 1; a[2] = 4; a[n_] := a[n] = Mod[n*a[n - 1] - (n - 1)*a[n - 2], n + 1]; Array[a, 100] (* Amiram Eldar, Aug 10 2021 *)
    nxt[{n_,a_,b_}]:={n+1,b,Mod[b(n+1)-n*a,n+2]}; NestList[nxt,{2,1,4},80][[;;,2]] (* Harvey P. Dale, Oct 15 2023 *)
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 4; for (n=3, nn, va[n] = (n*va[n-1] - (n-1)*va[n-2]) % (n+1);); va;} \\ Michel Marcus, Aug 10 2021

Formula

a(n) = 77 for n >= 2982.