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.
%I A244478 #17 Oct 02 2024 04:41:47 %S A244478 2,0,2,2,2,2,4,4,4,4,4,6,6,6,8,8,8,8,8,8,10,10,10,12,12,12,12,14,14, %T A244478 14,16,16,16,16,16,16,16,18,18,18,20,20,20,20,22,22,22,24,24,24,24,24, %U A244478 26,26,26,28,28,28,28,30,30,30,32,32,32,32,32,32,32,32,34,34,34,36,36,36,36,38,38,38 %N A244478 a(0)=2, a(1)=0, a(2)=2; 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. %D A244478 Higham, J.; Tanny, S. More well-behaved meta-Fibonacci sequences. Proceedings of the Twenty-fourth Southeastern International Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1993). Congr. Numer. 98(1993), 3-17. See Prop. 2.1. %H A244478 Reinhard Zumkeller, <a href="/A244478/b244478.txt">Table of n, a(n) for n = 0..10000</a> %H A244478 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a> %p A244478 f := proc(n) option remember; %p A244478 if n=0 then 2 %p A244478 elif n=1 then 0 %p A244478 elif n=2 then 2 %p A244478 else %p A244478 f(n-1-f(n-1))+f(n-2-f(n-2)); %p A244478 fi; %p A244478 end proc; %p A244478 [seq(f(n),n=0..2000)]; %t A244478 f[n_] := f[n] = Switch[n, 0, 2, 1, 0, 2, 2, _, %t A244478 f[n-1-f[n-1]]+f[n-2-f[n-2]]]; %t A244478 Table[f[n], {n, 0, 100}] (* _Jean-François Alcover_, Oct 02 2024 *) %o A244478 (Haskell) %o A244478 a244478 n = a244478_list !! n %o A244478 a244478_list = 2 : 0 : 2 : zipWith (+) xs (tail xs) %o A244478 where xs = map a244478 $ zipWith (-) [1..] $ tail a244478_list %o A244478 -- _Reinhard Zumkeller_, Jul 05 2014 %Y A244478 A006949, A240807, A240808 use the same recurrence. %Y A244478 See also A244479 (a(n)/2). %K A244478 nonn %O A244478 0,1 %A A244478 _N. J. A. Sloane_, Jul 02 2014