A244483 a(0)=3, a(1)=1, a(2)=0; thereafter a(n) = a(n-1-a(n-1))+a(n-2-a(n-2)) unless a(n-1) <= n-1 or a(n-2) <= n-2 in which case the sequence terminates.
3, 1, 0, 3, 3, 4, 2, 4, 6, 3, 2, 8, 9, 6, 7, 8, 8, 10, 10, 10, 9, 11, 10, 11, 18, 11, 9, 17, 12, 10, 18, 19, 18, 16, 17, 20, 18, 18, 20, 20, 20, 19, 19, 21, 21, 21, 29, 28, 20, 22, 29, 28, 22, 29, 36, 28, 27, 27, 28, 36, 29, 30, 38, 37, 27, 27, 38, 32, 32, 38, 37, 35, 34, 38, 40, 37, 37, 40, 38, 38, 39
Offset: 0
Keywords
References
- Higham, Jeff and Tanny, Stephen, A tamely chaotic meta-Fibonacci sequence. Twenty-third Manitoba Conference on Numerical Mathematics and Computing (Winnipeg, MB, 1993). Congr. Numer. 99 (1994), 67-94.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Index entries for Hofstadter-type sequences
Crossrefs
See A006949 for overview of sequences produced by this recurrence and various initial conditions.
Programs
-
Haskell
a244483 n = a244483_list !! n a244483_list = 3 : 1 : 0 : zipWith (+) xs (tail xs) where xs = map a244483 $ zipWith (-) [1..] $ tail a244483_list -- Reinhard Zumkeller, Jul 07 2014
-
Maple
f := proc(n) option remember; if n=0 then 3 elif n=1 then 1 elif n=2 then 0 else f(n-1-f(n-1))+f(n-2-f(n-2)); fi; end proc; [seq(f(n),n=0..80)];