A047520 a(n) = 2*a(n-1) + n^2, a(0) = 0.
0, 1, 6, 21, 58, 141, 318, 685, 1434, 2949, 5998, 12117, 24378, 48925, 98046, 196317, 392890, 786069, 1572462, 3145285, 6290970, 12582381, 25165246, 50331021, 100662618, 201325861, 402652398, 805305525, 1610611834, 3221224509
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..3000
- Filippo Disanto, Some Statistics on the Hypercubes of Catalan Permutations, Journal of Integer Sequences, Vol. 18 (2015), Article 15.2.2.
- Index entries for linear recurrences with constant coefficients, signature (5,-9,7,-2).
Programs
-
GAP
List([0..30], n-> 6*2^n -(n^2+4*n+6)); # G. C. Greubel, Jul 25 2019
-
Haskell
a047520 n = sum $ zipWith (*) (reverse $ take n $ tail a000290_list) a000079_list -- Reinhard Zumkeller, Nov 30 2012
-
Magma
[ 6*2^n-n^2-4*n-6: n in [0..30]]; // Vincenzo Librandi, Aug 22 2011
-
Mathematica
RecurrenceTable[{a[0]==0,a[n]==2a[n-1]+n^2},a[n],{n,30}] (* or *) LinearRecurrence[{5,-9,7,-2},{0,1,6,21},31] (* Harvey P. Dale, Aug 21 2011 *) f[n_]:= 2^n*Sum[i^2/2^i, {i, n}]; Array[f, 30] (* Robert G. Wilson v, Nov 28 2012 *)
-
PARI
vector(30, n, n--; 6*2^n -(n^2+4*n+6)) \\ G. C. Greubel, Jul 25 2019
-
Sage
[6*2^n -(n^2+4*n+6) for n in (0..30)] # G. C. Greubel, Jul 25 2019
Formula
a(n) = 2^n*Sum_{i=1..n} i^2 / 2^i. - Benoit Cloitre, Jan 27 2002
a(0)=0, a(1)=1, a(2)=6, a(3)=21, a(n) = 5*a(n-1) - 9*a(n-2) + 7*a(n-3) - 2*a(n-4). - Harvey P. Dale, Aug 21 2011
G.f.: x*(1+x)/((1-x)^3*(1-2*x)). - Harvey P. Dale, Aug 21 2011
E.g.f.: 6*exp(2*x) -(6 +5*x +x^2)*exp(x). - G. C. Greubel, Jul 25 2019
Comments