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.

A305845 a(1) = a(2) = a(3) = 1; for n > 3, a(n) = a(a(n-2)) + a(n-a(n-2)).

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7, 7, 7, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 17, 17, 18, 18, 18, 19, 20, 21, 22, 22, 23, 23, 24, 25, 25, 26, 26, 26, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 35, 36, 37, 37, 38, 39, 39, 39
Offset: 1

Views

Author

Altug Alkan, Jun 11 2018

Keywords

Comments

A solution to recursion of Mallows's sequence (A005229).

Crossrefs

Programs

  • Mathematica
    a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n - 2]] + a[n - a[n - 2]]; Array[a, 81] (* Michael De Vlieger, Jun 11 2018 *)
  • PARI
    a=vector(100); a[1]=a[2]=a[3]=1; for(n=4, #a, a[n] = a[a[n-2]] + a[n-a[n-2]]); a

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1.