A141015 a(0) = 0, a(1) = 1, a(2) = 2; for n > 2, a(n) = a(n-1) + 2*a(n-2) + a(n-3).
0, 1, 2, 4, 9, 19, 41, 88, 189, 406, 872, 1873, 4023, 8641, 18560, 39865, 85626, 183916, 395033, 848491, 1822473, 3914488, 8407925, 18059374, 38789712, 83316385, 178955183, 384377665, 825604416, 1773314929, 3808901426
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,2,1).
Programs
-
Mathematica
CoefficientList[Series[x (1 + x)/(1 - x - 2 x^2 - x^3), {x,0,50}], x] (* G. C. Greubel, Jun 09 2017 *)
-
PARI
x='x+O('x^50); concat([0], Vec(x*(1+x)/(1-x-2*x^2-x^3))) \\ G. C. Greubel, Jun 09 2017
-
Sage
from sage.combinat.sloane_functions import recur_gen3; it = recur_gen3(0,1,2,1,2,1); [next(it) for i in range(31)] # Zerinvary Lajos, May 17 2009
Formula
From R. J. Mathar, Aug 22 2008: (Start)
O.g.f.: x*(1 + x)/(1 - x - 2*x^2 - x^3).
a(n) = (-1)^(n+1)*A078039(n-1). (End)
Extensions
Typo in definition corrected by Paolo P. Lava, Jul 31 2008
Dysfunctional Maple program removed by R. J. Mathar, Oct 28 2009
Comments clarified by Petros Hadjicostas, Jun 12 2019
Comments