login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Partial sums of A000463.
2

%I #40 Mar 02 2023 12:30:03

%S 1,2,4,8,11,20,24,40,45,70,76,112,119,168,176,240,249,330,340,440,451,

%T 572,584,728,741,910,924,1120,1135,1360,1376,1632,1649,1938,1956,2280,

%U 2299,2660,2680,3080,3101,3542,3564,4048,4071,4600,4624,5200,5225,5850

%N Partial sums of A000463.

%C Sum of integers followed by squares.

%H Reinhard Zumkeller, <a href="/A159693/b159693.txt">Table of n, a(n) for n = 1..10000</a>

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

%F a(n) = (n^3+3*n^2+8*n+r(n))/24, where r(n) = 3*n+9 if n is odd, 3*n^2 if n is even.

%F G.f.: x*(1+x-x^2+x^3)/((1+x)^3*(x-1)^4). - _R. J. Mathar_, Apr 20 2009

%F a(n) = a(n-1)+3*a(n-2)-3*a(n-3)-3*a(n-4)+3*a(n-5)+a(n-6)-a(n-7). - _R. J. Mathar_, Apr 20 2009

%F a(n) = (2*n^3+9*n^2+19*n+9+3*(n^2-n-3)*(-1)^n)/48. - _Luce ETIENNE_, Dec 29 2014

%F E.g.f.: (2*x^3+15*x^2+30*x+9)*exp(x)/48 +(x^2-3)*exp(-x)/16. - _Robert Israel_, Dec 30 2014

%e For n=9, a(n) = 1+1+2+4+3+9+4+16+5 = 45.

%p seq((2*n^3+9*n^2+19*n+9+3*(n^2-n-3)*(-1)^n)/48, n=1..100); # _Robert Israel_, Dec 30 2014

%t CoefficientList[Series[x*(1+x-x^2+x^3)/((1+x)^3*(x-1)^4), {x, 0, 50}], x] (* or *) Table[(2*n^3+9*n^2+19*n+9+3*(n^2-n-3)*(-1)^n)/48, {n,0,50}] (* _G. C. Greubel_, Jun 02 2018 *)

%t Accumulate[Flatten[{#,#^2}&/@Range[30]]] (* _Harvey P. Dale_, Nov 30 2019 *)

%o (Magma) S:=&cat[ [ n, n^2 ]: n in [1..25] ]; [ n eq 1 select S[1] else Self(n-1)+S[n]: n in [1..#S] ]; // _Klaus Brockhaus_, Apr 20 2009

%o (Haskell)

%o a159693 n = a159693_list !! (n-1)

%o a159693_list = scanl1 (+) a000463_list -- _Reinhard Zumkeller_, Nov 08 2015

%Y Cf. A000290, A000463.

%K nonn

%O 1,2

%A _Gerald Hillier_, Apr 20 2009

%E More terms from _R. J. Mathar_ and _Klaus Brockhaus_, Apr 20 2009