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 r(n) = 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
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
Sequence in context: A226390 A156081 A368991 * A105047 A331135 A089881
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 April 26 05:19 EDT 2024. Contains 371989 sequences. (Running on oeis4.)