login
Partial sums of floor(n^2/6) (A056827).
2

%I #40 Mar 14 2022 10:02:54

%S 0,0,0,1,3,7,13,21,31,44,60,80,104,132,164,201,243,291,345,405,471,

%T 544,624,712,808,912,1024,1145,1275,1415,1565,1725,1895,2076,2268,

%U 2472,2688,2916,3156,3409,3675,3955,4249,4557,4879,5216,5568,5936,6320,6720,7136

%N Partial sums of floor(n^2/6) (A056827).

%C Quasipolynomial.

%H Vincenzo Librandi, <a href="/A171965/b171965.txt">Table of n, a(n) for n = 0..10000</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_09">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1,0,0,1,-3,3,-1).

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

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

%F a(n) = round((4*n^3 + 6*n^2 - 24*n - 13)/72).

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

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

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

%F G.f.: x^3*(1+x^2) / ( (1+x)*(1+x+x^2)*(x^2-x+1)*(x-1)^4 ). - _R. J. Mathar_, Jan 28 2012

%e a(5) = 7 = 0 + 0 + 0 + 1 + 2 + 4.

%p a(n):=round((2*n^3 +3*n^2 -12*n-6)/36)

%t Accumulate[Floor[Range[0,50]^2/6]] (* _Harvey P. Dale_, Jul 30 2020 *)

%o (Magma) [Round((2*n^3+3*n^2-12*n-6)/36): n in [0..60]]; // _Vincenzo Librandi_, Jun 25 2011

%o (PARI) a(n)=(2*n^3+3*n^2-12*n+7)\36 \\ _Charles R Greathouse IV_, Jan 29 2012

%o (Python)

%o a171965 = [0]

%o for n in range(1, 60): a171965.append(a171965[-1] + n*n//6)

%o print(a171965) # _Gennady Eremin_, Mar 13 2022

%Y Cf. A056827.

%K nonn,easy

%O 0,5

%A _Mircea Merca_, Nov 19 2010