login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 = a(n - a(floor(n/6)) for n == 5 (mod 6). 1
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Table of n, a(n) for n=0..86.

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}]

CROSSREFS

Cf. A004001, A147665, A147955.

Sequence in context: A093125 A226390 A156081 * A105047 A331135 A089881

Adjacent sequences:  A147951 A147952 A147953 * A147955 A147956 A147957

KEYWORD

nonn

AUTHOR

Roger L. Bagula, Nov 17 2008

EXTENSIONS

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

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 00:47 EDT 2022. Contains 353959 sequences. (Running on oeis4.)