%I #95 Sep 21 2024 03:50:18
%S 0,0,0,1,2,3,5,7,9,12,15,18,22,26,30,35,40,45,51,57,63,70,77,84,92,
%T 100,108,117,126,135,145,155,165,176,187,198,210,222,234,247,260,273,
%U 287,301,315,330,345,360,376,392,408,425,442,459,477,495,513,532,551,570
%N a(n) = Sum_{k=0..n} floor(k/3). (Partial sums of A002264.)
%C Complementary with A130481 regarding triangular numbers, in that A130481(n) + 3*a(n) = n(n+1)/2 = A000217(n).
%C Apart from offset, the same as A062781. - _R. J. Mathar_, Jun 13 2008
%C Apart from offset, the same as A001840. - _Michael Somos_, Sep 18 2010
%C The sum of any three consecutive terms is a triangular number. - _J. M. Bergot_, Nov 27 2014
%H Vincenzo Librandi, <a href="/A130518/b130518.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,1,-2,1).
%F G.f.: x^3 / ((1-x^3)*(1-x)^2).
%F a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5).
%F a(n) = (1/2)*floor(n/3)*(2*n - 1 - 3*floor(n/3)) = A002264(n)*(2n - 1 - 3*A002264(n))/2.
%F a(n) = (1/2)*A002264(n)*(n - 1 + A010872(n)).
%F a(n) = round(n*(n-1)/6) = round((n^2-n-1)/6) = floor(n*(n-1)/6) = ceiling((n+1)*(n-2)/6). - _Mircea Merca_, Nov 28 2010
%F a(n) = a(n-3) + n - 2, n > 2. - _Mircea Merca_, Nov 28 2010
%F a(n) = A214734(n, 1, 3). - _Renzo Benedetti_, Aug 27 2012
%F a(3n) = A000326(n), a(3n+1) = A005449(n), a(3n+2) = 3*A000217(n) = A045943(n). - _Philippe Deléham_, Mar 26 2013
%F a(n) = (3*n*(n-1) - (-1)^n*((1+i*sqrt(3))^(n-2) + (1-i*sqrt(3))^(n-2))/2^(n-3) - 2)/18, where i=sqrt(-1). - _Bruno Berselli_, Nov 30 2014
%F Sum_{n>=3} 1/a(n) = 20/3 - 2*Pi/sqrt(3). - _Amiram Eldar_, Sep 17 2022
%p seq(floor(n*(n-1)/6),n=0..60); # _Robert Israel_, Nov 27 2014
%t Table[n, {n, 0, 19}, {3}] // Flatten // Accumulate (* _Jean-François Alcover_, Jun 05 2013 *)
%o (Sage) [floor(binomial(n,2)/3) for n in range(0,60)] # _Zerinvary Lajos_, Dec 01 2009
%o (Magma) [Round(n*(n-1)/6): n in [0..60]]; // _Vincenzo Librandi_, Jun 25 2011
%o (PARI) a(n)=n*(n-1)\/6 \\ _Charles R Greathouse IV_, Jun 05 2013
%o (GAP) List([0..60], n-> Int(n*(n-1)/6)); # _G. C. Greubel_, Aug 31 2019
%Y Cf. A002265, A002266, A004526, A010872, A010873, A010874, A062781, A130482, A130483.
%K nonn,easy
%O 0,5
%A _Hieronymus Fischer_, Jun 01 2007