A014255 Expansion of (1+2*x+3*x^2)/((1-x)*(1-x^2)^2).
1, 3, 8, 12, 21, 27, 40, 48, 65, 75, 96, 108, 133, 147, 176, 192, 225, 243, 280, 300, 341, 363, 408, 432, 481, 507, 560, 588, 645, 675, 736, 768, 833, 867, 936, 972, 1045, 1083, 1160, 1200, 1281, 1323, 1408, 1452, 1541, 1587, 1680, 1728, 1825, 1875, 1976, 2028
Offset: 0
Examples
From _Gary W. Adamson_, May 14 2010: (Start) The first few rows of the generating triangle are 1; 1, 2; 1, 4, 3; 1, 4, 3, 4; 1, 4, 3, 8, 5; 1, 4, 3, 8, 5, 6; 1, 4, 3, 8, 5, 12, 7; 1, 4, 3, 8, 5, 12, 7, 8; 1, 4, 3, 8, 5, 12, 7, 16, 9; 1, 4, 3, 8, 5, 12, 7, 16, 9, 10; ... Row sums are 1, 3, 8, 12, 21, 27, 40, ... (End) G.f. = 1 + 3*x + 8*x^2 + 12*x^3 + 21*x^4 + 27*x^5 + 40*x^6 + 48*x^7 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
GAP
List([0..55], n-> (6*n^2+14*n+7 +(-1)^n*(2*n+1))/8); # G. C. Greubel, Jun 18 2019
-
Magma
[(6*n^2+14*n+7 +(-1)^n*(2*n+1))/8: n in [0..55]]; // G. C. Greubel, Jun 18 2019
-
Mathematica
Array[(# + 1)^2 - Floor[(# + 1)/2]^2 &, 52, 0] (* or *) CoefficientList[Series[(1+2x+3x^2)/((1-x)(1-x^2)^2), {x, 0, 51}], x] (* Michael De Vlieger, Dec 20 2017 *)
-
PARI
vector(55, n, n--; (6*n^2+14*n+7 +(-1)^n*(2*n+1))/8) \\ G. C. Greubel, Jun 18 2019
-
Sage
[(6*n^2+14*n+7 +(-1)^n*(2*n+1))/8 for n in (0..55)] # G. C. Greubel, Jun 18 2019
Formula
G.f.: (1+2*x+3*x^2)/((1-x)*(1-x^2)^2).
a(n) = (n+1)^2 - floor((n+1)/2)^2. - Franklin T. Adams-Watters, May 26 2006
a(n) = (6*n^2 + 14*n + 7 + (-1)^n*(2*n + 1))/8. - R. J. Mathar, Mar 22 2011
a(n) = (k+1)*(3*k+1) if n = 2*k, 3*(k+1)^2 if n = 2*k+1. - Michael Somos, Feb 27 2014
E.g.f.: ((4+9*x+3*x^2)*cosh(x) + (3+11*x+3*x^2)*sinh(x))/4. - G. C. Greubel, Jun 18 2019
Comments