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.

A147954 a(0) = 0, a(1) = a(2) = 1, a(n) = a(a(n-1)) + a(n-a(n-1)) for 3 <= n <= 5, and a(n) = a(a(n-1)) + r(n) for n >= 6, where r(n) = a(a(floor(n/6))) for n == 0, 1, 2, 3, 4 (mod 6), and r(n) = a(n - a(floor(n/6))) for n == 5 (mod 6).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 5, 4, 3, 3, 3, 3, 5, 4, 3, 3, 3, 3, 5, 4, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 6, 6, 6, 6, 6, 9, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 8, 5, 5, 5
Offset: 0

Views

Author

Roger L. Bagula, Nov 17 2008

Keywords

Crossrefs

Programs

  • Maple
    a := proc(n) local v; option remember;
    if n = 0 then v := 0; end if;
    if n = 1 or n = 2 then v := 1; end if;
    if 3 <= n and n <= 5 then v := a(a(n - 1)) + a(n - a(n - 1)); end if;
    if 6 <= n and 5 <> n mod 6 then v := a(a(n - 1)) + a(a(floor(n/6))); end if;
    if 6 <= n and 5 = n mod 6 then v := a(a(n - 1)) + a(n - a(floor(n/6))); end if; v; end proc; # Petros Hadjicostas, Apr 21 2020
  • Mathematica
    f[0] = 0; f[1] = 1; f[2] = 1;
    f[n_] := f[n] =
      f[f[n - 1]] +
       If[n < 6, f[n - f[n - 1]],
        If[Mod[n, 6] == 0, f[f[n/6]],
         If[Mod[n, 6] == 1, f[f[(n - 1)/6]],
          If[Mod[n, 6] == 2, f[f[(n - 2)/6]],
           If[Mod[n, 6] == 3, f[f[(n - 3)/6]],
            If[Mod[n, 6] == 4, f[f[(n - 4)/6]], f[n - f[(n - 5)/6]]]]]]]];
    Table[f[n], {n, 0, 300}]

Extensions

Name, data, and Mathematica program edited and corrected by Petros Hadjicostas, Apr 21 2020