OFFSET
0,2
COMMENTS
a(n) is the number of 3 X 3 matrices with nonnegative integer entries such that every row sum, column sum and the trace of the matrix is n. - Sharon Sela (sharonsela(AT)hotmail.com), May 20 2002
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-3,3,-1).
FORMULA
a(n) = 1 + 7*n/6 + n^2/2 + n^3/9 + 2*A049347(n-1)/9. - R. J. Mathar, Dec 03 2010
From Mircea Merca, Dec 03 2010: (Start)
a(n) = round((2*n + 3)*(n^2 + 3*n + 6)/18).
a(n) = floor((n + 2)*(2*n^2 + 5*n + 11)/18).
a(n) = ceiling((n + 1)*(2*n^2 + 7*n + 14)/18).
a(n) = round((n + 1)*(2*n^2 + 7*n + 14)/18).
a(n) = a(n-3) + n^2 + 2 for n > 2. (End)
E.g.f.: exp(x)*(1 + x*(32 + x*(15 + 2*x))/18) + 4*exp(-x/2)*sin(sqrt(3)*x/2)/(9*sqrt(3)). - Stefano Spezia, Oct 28 2022
MAPLE
A049347 := proc(n) op(1+(n mod 3), [1, -1, 0]) ; end proc:
MATHEMATICA
CoefficientList[ Series[(1 + x^3)/(1 - 3*x + 3*x^2 - 2*x^3 + 3*x^4 - 3*x^5 + x^6), {x, 0, 45}], x]
PROG
(Magma) [Round((2*n+3)*(n^2+3*n+6)/18): n in [0..50]]; // Vincenzo Librandi, Jun 25 2011
(PARI) Vec((1+x)*(1-x+x^2)/((1-x)^4*(1+x+x^2))+O(x^99)) \\ Charles R Greathouse IV, Sep 27 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 11 2002
STATUS
approved