cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Réjean Labrie

Réjean Labrie's wiki page.

Réjean Labrie has authored 1 sequences.

A235367 Sum of positive even numbers up to n^2.

Original entry on oeis.org

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
Offset: 1

Author

Réjean Labrie, Jan 07 2014

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • Magma
    [&+[i: i in [0..n^2 by 2]]: n in [1..50]]; // Bruno Berselli, Oct 26 2018
  • Mathematica
    Table[((n^2 - Mod[n^2, 2])/4)(n^2 + 2 - Mod[n^2, 2]), {n, 40}] (* Alonso del Arte, Jan 16 2014 *)
  • PARI
    a(n) = sum(i=1, n, i^2*(!(i % 2))); \\ Michel Marcus, Jan 18 2014
    

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) / ((x-1)^5*(x+1)^3). - Colin Barker, Jan 18 2014

Extensions

Corrected by Vincenzo Librandi, Jan 18 2014