OFFSET
0,4
COMMENTS
The only primes in this sequence are 3, 7, and 13: for n > 2 both a(2*n+1) = n*(n+1)*(4*n+5)/6 and a(2*n) = n*(n+1)*(4*n-1)/6 are composite. - Bruno Berselli, Jan 19 2011
a(n-1) is the number of integer-sided scalene triangles with largest side <= n, including degenerate (i.e., collinear) triangles. a(n-2) is the number of non-degenerate integer-sided scalene triangles. - Alexander Evnin, Oct 12 2010
Also n-th differences of square pyramidal numbers (A000330) and numbers of triangles in triangular matchstick arrangement of side n (A002717). - Konstantin P. Lakov, Apr 13 2018
REFERENCES
A. Yu. Evnin. Problem book on discrete mathematics. Moscow: Librokom, 2010; problem 787. (In Russian)
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
W. Lanssens, B. Demoen, and P.-L. Nguyen, The Diagonal Latin Tableau and the Redundancy of its Disequalities, Report CW 666, July 2014, Department of Computer Science, KU Leuven.
M. Merca, Inequalities and Identities Involving Sums of Integer Functions, J. Int. Seq. 14 (2011) # 11.9.1.
Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
FORMULA
G.f.: x^2 / ((1-x)^3 * (1-x^2)).
a(n) = (4*n^3 + 6*n^2 - 4*n - 3 + 3*(-1)^n)/48. - Bruno Berselli, Jan 19 2011
a(n) = A002623(n-2) for n >= 2. - Martin von Gagern, Dec 05 2014
a(n) = Sum_{i=0..n} A002620(i) = Sum_{i=0..n} floor(i/2)*ceiling(i/2) = Sum_{i=0..n} floor(i^2/4).
a(n) = round((2*n^3 + 3*n^2 - 2*n)/24) = round((4*n^3 + 6*n^2 - 4*n - 3)/48) = floor((2*n^3 + 3*n^2 - 2*n)/24) = ceiling((2*n^3 + 3*n^2 - 2*n - 3)/24). - Mircea Merca, Nov 23 2010
a(n) = a(n-2) + n*(n-1)/2, n > 1. - Mircea Merca, Nov 25 2010
a(n) = floor(n/2)*(floor(n/2)+1)*(8*ceiling(n/2) - 2*n - 1)/6. - Alexander Evnin, Oct 12 2010
a(n) = -a(-1-n) for all n in Z. - Michael Somos, Jan 14 2021
E.g.f.: (x*(3 + 9*x + 2*x^2)*cosh(x) - (3 - 3*x - 9*x^2 - 2*x^3)*sinh(x))/24. - Stefano Spezia, Jun 02 2021
EXAMPLE
a(57) = 0 + 0 + 1 + 2 + 4 + 6 + 9 + 12 + 16 + 20 + 25 + 30 + 36 + 42 + 49 + 56 + 64 + 72 + 81 + 90 + 100 + 110 + 121 + 132 + 144 + 156 + 169 + 182 + 196 + 210 + 225 + 240 + 256 + 272 + 289 + 306 + 324 + 342 + 361 + 380 + 400 + 420 + 441 + 462 + 484 + 506 + 529 + 552 + 576 + 600 + 625 + 650 + 676 + 702 + 729 + 756 + 784 + 812 = 15834.
MATHEMATICA
CoefficientList[Series[x^2/((1 - x)^3 (1 - x^2)), {x, 0, 50}], x] (* Vincenzo Librandi, Mar 26 2014 *)
Accumulate[Floor[Range[0, 60]^2/4]] (* or *) LinearRecurrence[{3, -2, -2, 3, -1}, {0, 0, 1, 3, 7}, 60] (* Harvey P. Dale, Feb 09 2020 *)
a[ n_] := Quotient[2 n^3 + 3 n^2 - 2 n, 24]; (* Michael Somos, Jan 14 2021 *)
PROG
(Magma) [Floor((2*n^3+3*n^2-2*n)/24): n in [0..60]]; // Vincenzo Librandi, Jun 25 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Feb 12 2010
STATUS
approved