login
Partial sums of floor(n^3/3).
1

%I #44 Feb 02 2023 20:40:28

%S 0,0,2,11,32,73,145,259,429,672,1005,1448,2024,2756,3670,4795,6160,

%T 7797,9741,12027,14693,17780,21329,25384,29992,35200,41058,47619,

%U 54936,63065,72065,81995,92917,104896,117997,132288,147840,164724,183014,202787,224120,247093,271789,298291,326685,357060,389505,424112,460976,500192,541858

%N Partial sums of floor(n^3/3).

%C Partial sums of A131476.

%H Vincenzo Librandi, <a href="/A173707/b173707.txt">Table of n, a(n) for n = 0..1000</a>

%H Mircea Merca, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL14/Merca/merca3.html">Inequalities and Identities Involving Sums of Integer Functions</a> J. Integer Sequences, Vol. 14 (2011), Article 11.9.1.

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

%F a(n) = Sum_{k=0..n} floor(k^3/3).

%F a(n) = round((n^4 + 2*n^3 + n^2 - 4*n)/12).

%F a(n) = round((n^4 + 2*n^3 + n^2 - 4*n - 2)/12).

%F a(n) = floor((n^4 + 2*n^3 + n^2 - 4*n)/12).

%F a(n) = ceiling((n+1)*(n^3 + n^2 - 4)/12).

%F a(n) = a(n-3) + n^3 - 3*n^2 + 5*n - 4, n > 2.

%F From _R. J. Mathar_, Nov 26 2010: (Start)

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

%F a(n) = n^4/12 + n^3/6 + n^2/12 - n/3 - 1/9 + A061347(n+1)/9. (End)

%e a(4) = floor(1/3) + floor(8/3) + floor(27/3) + floor(64/3) = 32.

%p A061347 := proc(n) op(1+(n mod 3),[-2,1,1]) ; end proc:

%p A173707 := proc(n) n^4/12+n^3/6+n^2/12-n/3-1/9 ; %+A061347(n+1)/9 ; end proc:

%p # program replaced by a structured version by _R. J. Mathar_, Nov 26 2010

%t Table[Sum[Floor[k^3/3],{k,0,n}],{n,0,60}] (* _G. C. Greubel_, Nov 23 2016 *)

%t Accumulate[Table[Floor[n^3/3],{n,0,60}]] (* or *) LinearRecurrence[{4,-6,5,-5,6,-4,1},{0,0,2,11,32,73,145},60] (* _Harvey P. Dale_, May 29 2018 *)

%o (Magma) [Floor((n^4+2*n^3+n^2-4*n)/12): n in [0..60]]; // _Vincenzo Librandi_, May 08 2011

%o (PARI) a(n)=(n^4+2*n^3+n^2-4*n)\12 \\ _Charles R Greathouse IV_, May 08 2011

%o (Sage) [floor(n*(n^3 +2*n^2 +n -4)/12) for n in (0..60)] # _G. C. Greubel_, Jul 02 2019

%o (Python)

%o def A173707(n): return n*(n*(n*(n + 2) + 1) - 4)//12 # _Chai Wah Wu_, Feb 02 2023

%Y Cf. A131476.

%K nonn,easy

%O 0,3

%A _Mircea Merca_, Nov 25 2010