

A108578


Number of 3 X 3 magic squares with magic sum 3n.


7



0, 0, 0, 0, 8, 24, 32, 56, 80, 104, 136, 176, 208, 256, 304, 352, 408, 472, 528, 600, 672, 744, 824, 912, 992, 1088, 1184, 1280, 1384, 1496, 1600, 1720, 1840, 1960, 2088, 2224, 2352, 2496, 2640, 2784, 2936, 3096, 3248, 3416, 3584, 3752, 3928, 4112, 4288
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,5


COMMENTS

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 6. (End)


LINKS



FORMULA

G.f.: [8*x^5*(1+2*x)] / [(1x)*(1x^2)*(1x^3)].


EXAMPLE

a(5) = 8 because there are 8 3 X 3 magic squares with entries 1,...,9 and magic sum 15.


MATHEMATICA

LinearRecurrence[{1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 8, 24}, 50] (* JeanFrançois Alcover, Sep 01 2018 *)
CoefficientList[Series[8 x^4 (1 + 2 x) / ((1  x) (1  x^2) (1  x^3)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 01 2018 *)


PROG

(PARI) a(n)=(1/9)*(2*n^232*n+[144, 78, 120, 126, 96, 102][(n%18)/3+1])
(PARI) x='x+O('x^99); concat(vector(4), Vec(8*x^5*(1+2*x)/((1x)*(1x^2)*(1x^3)))) \\ Altug Alkan, Sep 01 2018
(Magma) I:=[0, 0, 0, 0, 8, 24]; [n le 6 select I[n] else Self(n1)+Self(n2)Self(n4)Self(n5)+Self(n6): n in [1..60]]; // Vincenzo Librandi, Sep 01 2018


CROSSREFS

Equals 8 times the second differences of A055328.


KEYWORD

nonn


AUTHOR



EXTENSIONS

Corrected g.f. to account for previous change in parameter n from magic sum s to s/3; by Thomas Zaslavsky, Mar 12 2010


STATUS

approved



