

A240807


a(0)=a(1)=1, a(2)=2; thereafter a(n) = a(n1a(n1))+a(n2a(n2)) unless a(n1) <= n1 or a(n2) <= n2 in which case the sequence terminates.


4



1, 1, 2, 1, 1, 3, 3, 3, 2, 4, 6, 4, 4, 5, 4, 8, 9, 6, 7, 8, 8, 8, 9, 10, 10, 9, 13, 14, 10, 12, 13, 12, 14, 15, 14, 15, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 19, 23, 24, 20, 22, 22, 22, 25, 23, 22, 27, 27, 25, 28, 27, 27, 29, 29, 29, 29, 31, 31, 31, 32, 32, 32, 33, 34, 34, 35, 36, 36, 36, 37, 38, 38, 39, 40, 40, 40, 40, 39, 43, 44, 40, 42, 42, 42
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


REFERENCES

Higham, Jeff and Tanny, Stephen, A tamely chaotic metaFibonacci sequence. Twentythird Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1993). Congr. Numer. 99 (1994), 6794.


LINKS

N. J. A. Sloane, Table of n, a(n) for n = 0..20000
Index entries for Hofstadtertype sequences


MAPLE

a:=proc(n) option remember;
if n = 0 then 1
elif n = 1 then 1
elif n = 2 then 2
else
if (a(n1) <= n1) and (a(n2) <= n2) then
a(n1a(n1))+a(n2a(n2));
else lprint("died with n =", n); return (1);
fi;
fi; end;
[seq(a(n), n=0..100)];


PROG

(Haskell)
a240807 n = a240807_list !! n
a240807_list = 1 : 1 : 2 : zipWith (+) xs (tail xs)
where xs = map a240807 $ zipWith () [1..] $ tail a240807_list
 Reinhard Zumkeller, Apr 17 2014


CROSSREFS

A006949 and A240808 have the same recurrence but different initial conditions.
Sequence in context: A308028 A320902 A189913 * A334347 A283672 A053268
Adjacent sequences: A240804 A240805 A240806 * A240808 A240809 A240810


KEYWORD

sign


AUTHOR

N. J. A. Sloane, Apr 15 2014


STATUS

approved



