OFFSET
1,3
COMMENTS
Is this A185048 with the leading two 1's replaced by 0's? - R. J. Mathar, Apr 17 2014.
This is true, see formulas below. - Bruno Berselli, Apr 18 2014
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..20000
Joseph Callaghan, John J. Chew III, and Stephen M. Tanny, On the behavior of a family of meta-Fibonacci sequences, SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See Fig. 1.4.
Craig Knecht, Row sums of superimposed binary filled triangle.
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
From Bruno Berselli, Apr 18 2014: (Start)
G.f.: 2*x^3*(1 + x + x^2)/((1 - x)^2*(1 + x)^2*(1 + x^2)).
a(n) = n - 1 - ((-1)^n + 1)*(n - (-1)^floor(n/2) - 1)/4. Therefore:
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.
a(n) = a(n-2) + a(n-4) - a(n-6) for n>6. (End)
MAPLE
#T_s, k(n) from Callaghan et al. Eq. (1.6).
s:=0; k:=3;
a:=proc(n) option remember; global s, k;
if n <= 2 then 0
elif n = 3 then 2
else
add(a(n-i-s-a(n-i-1)), i=0..k-1);
fi; end;
t1:=[seq(a(n), n=1..100)];
MATHEMATICA
LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 0, 2, 2, 4, 2}, 100] (* Vincenzo Librandi, Jul 12 2015 *)
PROG
(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
(Magma) [n-1-((-1)^n+1)*(n-(-1)^Floor(n/2)-1)/4: n in [1..80]]; // Vincenzo Librandi, Jul 12 2015
CROSSREFS
Cf. A185048.
AUTHOR
N. J. A. Sloane, Apr 16 2014
STATUS
approved