|
|
A051235
|
|
Number of distinct most-perfect pandiagonal magic squares of order 4n in the Frenicle standard form.
|
|
3
|
|
|
1, 48, 368640, 22295347200, 932242784256000, 144982397807493120000, 221340898613898982195200000, 21421302878528360015430942720000, 59225618198555209770663470432256000000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
A most-perfect magic square is a pan-diagonal magic square made of the numbers 1 to N^2, N = 4n, such that (1) each 2 X 2 subsquare, including wrap-round, sums to S/n, where S = N(N^2 + 1)/2 is the magic sum; and (2) all pairs of integers distant N/2 along any diagonal (major or broken) are complementary, i.e., they sum to N^2 + 1. - M. F. Hasler, Oct 20 2018
The most-perfect magic squares are in an one-to-one correspondence with the reversible squares (cf. A308951). - Max Alekseyev, Jul 03 2019
|
|
REFERENCES
|
K. Ollerenshaw and D. S. Brée, Most-perfect Pan-diagonal Magic Squares: Their Construction and Enumeration, Inst. Math. Applic., Southend-on-Sea, England, 1998.
I. Stewart, Most-perfect magic squares, Sci. Amer., Nov. 1999, pp. 122-123.
|
|
LINKS
|
|
|
FORMULA
|
For n >= 1, let N := 4n = Product_{g} (p_g)^(s_g), where p_g are distinct primes, and W_v(n) := Sum_{i=0..v} (-1)^(v+i) * binomial(v+1,i+1) * Product_{g} binomial(s_g+i,i). Then a(n) = 2^(N-2) * (2n)!^2 * Sum_{v=0..Sum_{g} s_g} W_v(N)*(W_v(N)+W_{v+1}(N)). - Floor van Lamoen, Aug 16 2001; corrected by Max Alekseyev, Jul 02 2019
|
|
MATHEMATICA
|
a[n_] := Module[{s, W}, If[n==0, Return[1]]; s = FactorInteger[4n][[All, 2]]; W = Table[Sum[(-1)^(V-i-1) Binomial[V, i+1] Product[Binomial[s[[g]] + i, i], {g, 1, Length[s]}], {i, 0, V-1}], {V, 1, Total[s]+1}]; 2^(4n-2) (2n)!^2 Sum[W[[V]] (W[[V]] + W[[V+1]]), {V, 1, Length[W]-1}]];
|
|
PROG
|
(PARI) { A051235(n) = if(n==0, return(1)); my(s=factor(4*n)[, 2], W=vector(vecsum(s)+1, V, sum(i=0, V-1, (-1)^(V-i-1) * binomial(V, i+1) * prod(g=1, #s, binomial(s[g]+i, i)) ))); 2^(4*n-2) *(2*n)!^2 * sum(V=1, #W-1, W[V]*(W[V]+W[V+1])); } \\ Implements the formula, where our W has indices V := v+1 = 1..Sum(s_g)+1 instead of 0..Sum(s_g), for technical reasons. - M. F. Hasler, Oct 20 2018; corrected by Max Alekseyev, Jul 02 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|