OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
R. P. Stanley, Examples of Magic Labelings, Unpublished Notes, 1973 [Cached copy, with permission]
M. M. Ahmed, Algebraic Combinatorics of Magic Squares, math.CO/0405476.
Index entries for linear recurrences with constant coefficients, signature (5,-9,5,5,-9,5,-1).
FORMULA
a(n) = (1/32)*(29*C(n+5,5) + 21*C(n+4,5) + 126*C(n+3,5) - 34*C(n+2,5) + 21*C(n+1,5) - 3*C(n,5) + 3*(-1)^n). [Stanley]. - N. J. A. Sloane, Jul 07 2014
G.f.: (x^4+x^3+6x^2+x+1)/((1-x)^6*(1+x)) [Stanley; Ahmed].
MAPLE
a := proc(r) local r1 ; r1 := r^5/24+5*r^4/16+25*r^3/24+15*r^2/8+23*r/12 ; if r mod 2 = 0 then r1+1 ; else r1+13/16 ; fi ; end: for n from 0 to 30 do printf("%d ", a(n)) ; od;
MATHEMATICA
CoefficientList[Series[(x^4 + x^3 + 6x^2 + x + 1)/(1 - x)^6/(1 + x), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 12 2012 *)
LinearRecurrence[{5, -9, 5, 5, -9, 5, -1}, {1, 6, 27, 87, 228, 513, 1034}, 40] (* Harvey P. Dale, Sep 10 2024 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
R. J. Mathar, Jan 25 2007
EXTENSIONS
Stanley reference added by N. J. A. Sloane, Jul 07 2014
STATUS
approved