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 A240828 #37 Sep 08 2022 08:46:07 %S A240828 0,0,2,2,4,2,6,4,8,4,10,6,12,6,14,8,16,8,18,10,20,10,22,12,24,12,26, %T A240828 14,28,14,30,16,32,16,34,18,36,18,38,20,40,20,42,22,44,22,46,24,48,24, %U A240828 50,26,52,26,54,28,56,28,58,30,60,30,62,32,64,32,66,34,68,34,70,36,72,36,74,38,76,38,78,40,80,40 %N A240828 a(1)=a(2)=0, a(3)=2; thereafter a(n) = Sum( a(n-i-s-a(n-i-1)), i=0..k-1 ), where s=0, k=3. %C A240828 Is this A185048 with the leading two 1's replaced by 0's? - _R. J. Mathar_, Apr 17 2014. %C A240828 This is true, see formulas below. - _Bruno Berselli_, Apr 18 2014 %H A240828 N. J. A. Sloane, <a href="/A240828/b240828.txt">Table of n, a(n) for n = 1..20000</a> %H A240828 Joseph Callaghan, John J. Chew III, and Stephen M. Tanny, <a href="http://dx.doi.org/10.1137/S0895480103421397">On the behavior of a family of meta-Fibonacci sequences</a>, SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See Fig. 1.4. %H A240828 Craig Knecht, <a href="/A240828/a240828.jpg">Row sums of superimposed binary filled triangle.</a> %H A240828 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a> %H A240828 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1). %F A240828 From _Bruno Berselli_, Apr 18 2014: (Start) %F A240828 G.f.: 2*x^3*(1 + x + x^2)/((1 - x)^2*(1 + x)^2*(1 + x^2)). %F A240828 a(n) = n - 1 - ((-1)^n + 1)*(n - (-1)^floor(n/2) - 1)/4. Therefore: %F A240828 a(2h+1) = 2h, a(2h) = 2*floor(h/2), or also: a(4h) = a(4h+2) = 2h, a(4h+1) = 4h, a(4h+3) = 4h+2. %F A240828 a(n) = a(n-2) + a(n-4) - a(n-6) for n>6. (End) %p A240828 #T_s,k(n) from Callaghan et al. Eq. (1.6). %p A240828 s:=0; k:=3; %p A240828 a:=proc(n) option remember; global s,k; %p A240828 if n <= 2 then 0 %p A240828 elif n = 3 then 2 %p A240828 else %p A240828 add(a(n-i-s-a(n-i-1)),i=0..k-1); %p A240828 fi; end; %p A240828 t1:=[seq(a(n),n=1..100)]; %t A240828 LinearRecurrence[{0, 1, 0, 1, 0, -1},{0, 0, 2, 2, 4, 2}, 100] (* _Vincenzo Librandi_, Jul 12 2015 *) %o A240828 (Magma) [n le 3 select 2*Floor((n-1)/2) else Self(n-Self(n-1))+Self(n-1-Self(n-2))+Self(n-2-Self(n-3)): n in [1..100]]; // _Bruno Berselli_, Apr 18 2014 %o A240828 (Magma) [n-1-((-1)^n+1)*(n-(-1)^Floor(n/2)-1)/4: n in [1..80]]; // _Vincenzo Librandi_, Jul 12 2015 %Y A240828 Cf. A185048. %K A240828 nonn,look,hear,easy %O A240828 1,3 %A A240828 _N. J. A. Sloane_, Apr 16 2014