login
a(n) = n*(2*n^2 + 3), n >= 1; a(0)=1.
1

%I #22 Jul 12 2022 17:48:43

%S 1,5,22,63,140,265,450,707,1048,1485,2030,2695,3492,4433,5530,6795,

%T 8240,9877,11718,13775,16060,18585,21362,24403,27720,31325,35230,

%U 39447,43988,48865,54090,59675,65632,71973,78710,85855,93420,101417,109858,118755,128120,137965

%N a(n) = n*(2*n^2 + 3), n >= 1; a(0)=1.

%C a(n) is the sum of consecutive strings of positive integers of length 2*n, starting with the integer 2; and a(0) = 1.

%H Colin Barker, <a href="/A288534/b288534.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).

%F From _Colin Barker_, Aug 14 2017: (Start)

%F G.f.: (1 + x + 8*x^2 + x^3 + x^4) / (1 - x)^4.

%F a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4) for n > 4.

%F (End)

%e a(1) = 5 = 2 + 3;

%e a(2) = 22 = 4 + 5 + 6 + 7;

%e a(3) = 63 = 8 + 9 + 10 + 11 + 12 + 13.

%t Table[Boole[n == 0] + n (2 n^2 + 3), {n, 0, 41}] (* or *)

%t CoefficientList[Series[(1 + x + 8 x^2 + x^3 + x^4)/(1 - x)^4, {x, 0, 41}], x] (* _Michael De Vlieger_, Aug 15 2017 *)

%t LinearRecurrence[{4,-6,4,-1},{1,5,22,63,140},50] (* _Harvey P. Dale_, Jul 12 2022 *)

%o (PARI) a(n) = if (n==0, 1, n*(2*n^2 + 3)); \\ _Michel Marcus_, Aug 14 2017

%o (PARI) Vec((1 + x + 8*x^2 + x^3 + x^4) / (1 - x)^4 + O(x^60)) \\ _Colin Barker_, Aug 14 2017

%K nonn,easy

%O 0,2

%A _Enrique Navarrete_, Aug 12 2017