

A235367


Sum of positive even numbers up to n^2.


1



0, 6, 20, 72, 156, 342, 600, 1056, 1640, 2550, 3660, 5256, 7140, 9702, 12656, 16512, 20880, 26406, 32580, 40200, 48620, 58806, 69960, 83232, 97656, 114582, 132860, 154056, 176820, 202950, 230880, 262656, 296480, 334662, 375156, 420552, 468540, 522006, 578360, 640800, 706440, 778806
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

Consider a square array of side n in which we write the integers from 1 to n in any order. This sequence gives the sum of the even numbers in the array.


LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,2,6,0,6,2,2,1).


FORMULA

a(n) = (n^4 + 2n^2)/4 if n is even, a(n) = (n^4  1)/4 if n is odd.
a(n) = ((n^2  (n^2 mod 2))/4)(n^2 + 2  (n^2 mod 2)).  Alonso del Arte, Jan 16 2014
a(n) = A110660(n^2).  Michel Marcus, Jan 18 2014
G.f.: 2*x^2*(3*x^4+4*x^3+10*x^2+4*x+3) / ((x1)^5*(x+1)^3).  Colin Barker, Jan 18 2014


EXAMPLE

a(1) = 0 because there are no even numbers between 1 and itself.
a(2) = 6 because between 1 and 2^2 there are the even numbers 2 and 4, which add up to 6.
a(3) = 20 because between 1 and 3^2 there are the even numbers 2, 4, 6 and 8, which add up to 20.


MATHEMATICA

Table[((n^2  Mod[n^2, 2])/4)(n^2 + 2  Mod[n^2, 2]), {n, 40}] (* Alonso del Arte, Jan 16 2014 *)


PROG

(PARI) a(n) = sum(i=1, n, i^2*(!(i % 2))); \\ Michel Marcus, Jan 18 2014
(MAGMA) [&+[i: i in [0..n^2 by 2]]: n in [1..50]]; // Bruno Berselli, Oct 26 2018


CROSSREFS

Cf. A002620, A083374.
Sequence in context: A074353 A075055 A146891 * A189604 A153372 A028402
Adjacent sequences: A235364 A235365 A235366 * A235368 A235369 A235370


KEYWORD

nonn,easy


AUTHOR

Réjean Labrie, Jan 07 2014


EXTENSIONS

Corrected by Vincenzo Librandi, Jan 18 2014


STATUS

approved



