A000253 a(n) = 2*a(n-1) - a(n-2) + a(n-3) + 2^(n-1).
0, 1, 4, 11, 27, 63, 142, 312, 673, 1432, 3015, 6295, 13055, 26926, 55284, 113081, 230572, 468883, 951347, 1926527, 3894878, 7863152, 15855105, 31936240, 64269135, 129234351, 259690239, 521524126, 1046810092, 2100221753, 4212028452, 8444387067
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Mathematics Stack Exchange, Recurrence relations - binary substrings
- Index entries for linear recurrences with constant coefficients, signature (4,-5,3,-2).
Programs
-
Maple
f := proc(n) option remember; if n<=1 then n else if n<=3 then 7*n-10; else 2*f(n-1)-f(n-2)+f(n-3)+2^(n-1); fi; fi; end; # second Maple program: a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <-2|3|-5|4>>^n)[3, 4]: seq(a(n), n=0..30); # Alois P. Heinz, Mar 27 2017
-
Mathematica
nn=50; a=x^2/(1-x)^2; Drop[CoefficientList[Series[a x/(1-a x)/(1-2x), {x,0,nn}], x], 2] (* Geoffrey Critzer, Nov 26 2013 *) LinearRecurrence[{4, -5, 3, -2}, {0, 1, 4, 11}, 32] (* Jean-François Alcover, Feb 06 2016 *)
Formula
From Ralf Stephan, Aug 19 2004: (Start)
G.f.: x/((1-2*x)*(1 - 2*x + x^2 - x^3)). (End)
Comments