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.

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

Original entry on oeis.org

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

Views

Author

Altug Alkan, Jun 21 2018

Keywords

Comments

Let a_i(n) = n - a_i(a_i(n-i)) - a_i(n-a_i(n-i)). This sequence is generated by a_2(n) with initial conditions 1, 1.

Crossrefs

Programs

  • GAP
    a:=[1,1];; for n in [3..100] do a[n]:=n-a[a[n-2]]-a[n-a[n-2]]; od; a; # Muniru A Asiru, Jun 26 2018
  • Maple
    a:=proc(n) option remember: if n<3 then 1 else n-procname(procname(n-2))-procname(n-procname(n-2)) fi; end: seq(a(n), n=1..100); # Muniru A Asiru, Jun 26 2018
  • PARI
    a=vector(99); a[1]=a[2]=1; for(n=3, #a, a[n] = n-a[a[n-2]]-a[n-a[n-2]]); a
    

Formula

a(n+1) - a(n) = 0 or 1 for all n >= 1 and a(n) hits every positive integer.