login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A100568
Number of compositions of n(n^2+1)/2 into n distinct parts each no more than n^2.
2
1, 1, 4, 48, 2064, 167280, 23136480, 4824953280, 1417422988800, 557894688341760, 283527366696806400, 180770613278509900800, 141310830114906688051200, 132919668653581764822067200, 148111929489204170921816985600, 192952383265326280925512415232000
OFFSET
0,3
COMMENTS
In an n X n magic square, each row and column is a composition of type described.
FORMULA
a(n) = A000142(n)*A052456(n). a(n) is close to n^(2n-5/2)*sqrt(6/(pi*e)) in the sense that the ratio between the two tends to 1 as n increases. Experimentally, something like n^(2n) * sqrt(6 / (pi * e * (n^5 - 1.366...n^4 + 1.146...n^3 - 0.826...n^2 + 0.413...n + 0.115...))) seems to be even closer.
EXAMPLE
a(2)=4 since 5 can be written 1+4, 2+3, 3+2 or 4+1.
MAPLE
b := proc(n, i, t) option remember;
`if`(n<t*(t+1)/2 or n>t*(2*i-t+1)/2, 0,
`if`(n=0, 1, b(n, i-1, t) + `if`(n<i, 0, b(n-i, i-1, t-1)))) end:
a := n -> `if`(n=0, 1, n!*b(n*(n^2+1)/2, n^2, n)): seq(a(n), n=0..12); # Peter Luschny, May 06 2014, after Alois P. Heinz
MATHEMATICA
RecursionLimit = 1000; b[n_, i_, t_] /; i < t || n < t*((t+1)/2) || n > t*((2*i-t+1)/2) = 0; b[0, _, _] = 1; b[n_, i_, t_] := b[n, i, t] = b[n, i-1, t] + If[n < i, 0, b[n-i, i-1, t-1]]; a[_, 0] = 1; a[0, _] = 0; a[n_, k_] := With[{s = k*(k*n+1)}, If[Mod[s, 2] == 1, 0, b[s/2, k*n, k]]]; a[n_] := a[n] = a[n, n]*n!; Table[Print[a[n]]; a[n], {n, 0, 14}] (* Jean-François Alcover, Aug 15 2013, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A360820 A362828 A197927 * A112693 A239162 A136384
KEYWORD
nonn
AUTHOR
Henry Bottomley, Nov 28 2004
STATUS
approved