OFFSET
0,2
COMMENTS
Number of 3 X 3 X 3 arrays M_ijk (1 <= i,j,k <= 3) satisfying Sum_i M_ijk = n (all j,k), Sum_j M_ijk = n (all i,k), Sum_k M_ijk = n (all i,j) and 0 <= M_ijk <= n.
The constraints imply that Sum_{i,j,k} M_ijk = 9n.
This is a "magic cube" in Stanley's notation (see Stanley references). - N. J. A. Sloane, Jul 07 2014
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
R. P. Stanley, Enumerative Combinatorics, Wadsworth, Vol. 1, Second Edition, Section 4.6.1.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
A. G. Bell, Partitioning integers in n dimensions, The Computer Journal, 13 (1970), 278-283.
R. P. Stanley, Examples of Magic Labelings, Unpublished Notes, 1973. [Cached copy, with permission]
Index entries for linear recurrences with constant coefficients, signature (9,-36,84,-126,126,-84,36,-9,1).
FORMULA
a(n) = (1/4032) * m * (m * (m * (31 * m + 1004) + 6820) + 4272) + 1, where m = n*(n+1) (from the Bell reference). - Sean A. Irvine, Jul 01 2014
G.f.: -(x^8+3*x^7+60*x^6+7*x^5+168*x^4+7*x^3+60*x^2+3*x+1) / (x-1)^9. - Colin Barker, Jul 01 2014
EXAMPLE
Comment from N. J. A. Sloane, Jul 06 2014: (Start)
Here are four of the twelve arrays showing that a(1) = 12 (each row shows top face, middle face, bottom face):
-----------
100 010 001
010 001 100
001 100 010
-----------
100 001 010
010 100 001
001 010 100
-----------
001 010 100
010 100 001
100 001 010
-----------
001 100 010
010 001 100
100 010 001
-----------
Each face must show one of the six 3 X 3 permutation matrices. There are 6 choices for the top face, and for each of these there are two choices for the second face and the third face is then determined, for a total of a(1)=6*2*1=12. (End)
MAPLE
A002721:=n->(1/4032)*n*(n+1)*(n*(n+1)*(n*(n+1)*(31*n*(n+1)+1004)+6820)+ 4272)+1: seq(A002721(n), n=0..30); # Wesley Ivan Hurt, Jul 01 2014
MATHEMATICA
CoefficientList[Series[-(x^8 + 3*x^7 + 60*x^6 + 7*x^5 + 168*x^4 + 7*x^3 + 60*x^2 + 3*x + 1)/(x - 1)^9, {x, 0, 30}], x] (* Wesley Ivan Hurt, Jul 01 2014 *)
PROG
(PARI) Vec(-(x^8+3*x^7+60*x^6+7*x^5+168*x^4+7*x^3+60*x^2+3*x+1)/(x-1)^9 + O(x^100)) \\ Colin Barker, Jul 01 2014
(Magma) [(1/4032)*n*(n+1)*(n*(n+1)*(n*(n+1)*(31*n*(n+1)+1004)+6820)+4272)+1 : n in [0..30] ]; // Wesley Ivan Hurt, Jul 01 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Sean A. Irvine, Jul 01 2014
Edited by N. J. A. Sloane, Jul 06 2014
STATUS
approved