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.

A108576 Number of 3 X 3 magic squares (with distinct positive entries) having all entries < n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, 40, 64, 96, 128, 184, 240, 320, 400, 504, 608, 744, 880, 1056, 1232, 1440, 1648, 1904, 2160, 2464, 2768, 3120, 3472, 3880, 4288, 4760, 5232, 5760, 6288, 6888, 7488, 8160, 8832, 9576, 10320, 11144, 11968, 12880, 13792, 14784, 15776
Offset: 1

Views

Author

Thomas Zaslavsky and Ralf Stephan, Jun 11 2005

Keywords

Comments

From Thomas Zaslavsky, Mar 12 2010: (Start)
A magic square has distinct positive integers in its cells, whose sum is the same (the "magic sum") along any row, column, or main diagonal.
a(n) is given by a quasipolynomial of period 12. (End)

Examples

			a(10) = 8 because there are 8 3 X 3 magic squares with distinct entries < 10 (they are the standard magic squares).
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, -1, 0, 1, -2, 2, -2, 1, 0, -1, 2, -1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, 40}, 60] (* Jean-François Alcover, Nov 12 2018 *)
    CoefficientList[Series[(8 x^10 (2 x^2 + 1)) / ((1 - x^6) (1 - x^4) (1 - x)^2), {x, 0, 60}], x] (* Vincenzo Librandi, Nov 12 2018 *)
  • PARI
    a(n)=1/6*(n^3-16*n^2+(76-3*(n%2))*n -[96,58,96,102,112,90,96,70,96,90,112,102][(n%12)+1])

Formula

G.f.: (8*x^10*(2*x^2+1)) / ((1-x^6)*(1-x^4)*(1-x)^2).
a(n) is given by a quasipolynomial of period 12.

Extensions

Edited by N. J. A. Sloane, Feb 05 2010