A049864 a(n) = Sum_{k=0,1,2,...,n-4,n-2,n-1} a(k); a(n-3) is not a summand, with a(0)=a(1)=a(2)=1.
1, 1, 1, 2, 4, 8, 15, 28, 52, 97, 181, 338, 631, 1178, 2199, 4105, 7663, 14305, 26704, 49850, 93058, 173717, 324288, 605368, 1130077, 2109583, 3938086, 7351463, 13723420, 25618337, 47823297, 89274637, 166654357, 311103754, 580756168, 1084132616, 2023815835
Offset: 0
Links
- R. Doroslovacki, Binary sequences without 011...110 (k-1 1's) for fixed k, Mat. Vesnik 46 (1994), no. 3-4, 93-98.
- Index entries for linear recurrences with constant coefficients, signature (2,0,-1,1).
Programs
-
Maple
(With a different offset:) a[0]:=1:a[1]:=2:a[2]:=4:a[3]:=8: for n from 4 to 35 do a[n]:=2*a[n-1]-a[n-3]+a[n-4] od: seq(a[n],n=0..35); # Emeric Deutsch, May 04 2006
-
Mathematica
LinearRecurrence[{2,0,-1,1},{1,1,1,2},40] (* Harvey P. Dale, Sep 24 2013 *)
Formula
a(n) = 2*a(n-1) - a(n-3) + a(n-4).
G.f.: (1+z)*(1-z)^2/(1 - 2z + z^3 - z^4). - Emeric Deutsch, May 04 2006
Extensions
Edited by N. J. A. Sloane, Nov 16 2007, at the suggestion of Max Alekseyev
Comments