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.

A087777 a(1) = ... = a(4) = 1; a(n) = a(n - a(n-2)) + a(n - a(n-4)).

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 6, 7, 7, 5, 3, 8, 9, 11, 12, 9, 9, 13, 11, 9, 13, 16, 13, 19, 16, 11, 14, 16, 21, 22, 14, 14, 19, 17, 22, 27, 25, 16, 20, 28, 22, 22, 26, 25, 24, 32, 26, 22, 29, 29, 32, 35, 32, 27, 26, 34, 30, 33, 40, 25, 27, 46, 40, 33, 32, 28, 36, 50, 44, 31, 36, 38, 46, 53, 41, 29, 41
Offset: 1

Views

Author

Roger L. Bagula, Oct 05 2003

Keywords

Comments

This is the sequence Q(2,4) in the Hofstadter-Huber classification.
It is not known if this sequence is defined for all positive n. Balamohan et al. comment that it shows "inscrutably wild behavior".

Crossrefs

Cf. A005185 (Q(1,2)), A063882 (Q(1,4)), A046700.

Programs

  • Magma
    [n le 4 select 1 else Self(n-Self(n-2))+Self(n-Self(n-4)): n in [1..80]]; // Vincenzo Librandi, Sep 10 2016
  • Maple
    a := proc(n) option remember; if n<=4 then 1 else if n > a(n-2) and n > a(n-4) then RETURN(a(n-a(n-2))+a(n-a(n-4))); else ERROR(" died at n= ", n); fi; fi; end;
  • Mathematica
    a[n_] := a[n] = If[n <= 4, 1, a[n - a[n - 2]] + a[n - a[n - 4]]];
    Array[a, 80] (* Jean-François Alcover, Nov 24 2017 *)

Extensions

Edited by N. J. A. Sloane, Nov 06 2007