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.

A287422 a(1) = a(2) = 1; a(n) = n - a(a(n-1)) - a(n-a(n-1)) for n > 2.

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jun 24 2017

Keywords

Crossrefs

Programs

  • Magma
    I:=[1,1,1,2]; [n le 4 select I[n] else n - Self(Self(n-1)) - Self(n-Self(n-1)): n in [1..100]]; // Vincenzo Librandi, Aug 08 2018
  • Mathematica
    Nest[Function[{a, n}, Append[a, n - a[[a[[-1]] ]] - a[[-a[[-1]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, 80] (* Michael De Vlieger, Aug 07 2018 *)
  • PARI
    q=vector(10000); q[1]=q[2]=1; for(n=3, #q, q[n]=n-q[q[n-1]]-q[n-q[n-1]]); q