[go: up one dir, main page]

login
A279905
Number of 2 X 2 matrices with entries in {0,1,...,n} and odd trace with no elements repeated.
1
0, 0, 0, 16, 72, 216, 480, 960, 1680, 2800, 4320, 6480, 9240, 12936, 17472, 23296, 30240, 38880, 48960, 61200, 75240, 91960, 110880, 133056, 157872, 186576, 218400, 254800, 294840, 340200, 389760, 445440, 505920, 573376, 646272, 727056, 813960, 909720
OFFSET
0,4
FORMULA
a(n) = ((n-2)*(n-1)*(2*(n+1)^2-(-1)^n-1))/4 for n>=0 .
From Colin Barker, Dec 26 2016: (Start)
a(n) = (n^4 - n^3 - 4*n^2 + 4*n)/2 for n even.
a(n) = (n^4 - n^3 - 3*n^2 + n + 2)/2 for n odd.
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5) - 2*a(n-6) - 2*a(n-7) + a(n-8) for n>7.
G.f.: 8*x^3*(2 + 5*x + 5*x^2) / ((1 - x)^5*(1 + x)^3).
(End)
E.g.f.: (1/4)*((-2 - 2*x - x^2)*exp(-x) + (2 -2*x + x^2 + 10*x^3 + 2*x^4 )*exp(x)). - G. C. Greubel, Dec 26 2016
MATHEMATICA
LinearRecurrence[{2, 2, -6, 0, 6, -2, -2, 1}, {0, 0, 0, 16, 72, 216, 480, 960}, 50] (* G. C. Greubel, Dec 26 2016 *)
PROG
(Python)
def t(n):
s=0
for a in range(0, n+1):
for b in range(0, n+1):
if a!=b:
for c in range(0, n+1):
if a!=c and b!=c:
for d in range(0, n+1):
if d!=a and d!=b and d!=c:
if (a+d)%2==1:
s+=1
return s
for i in range(0, 201):
print str(i)+" "+str(t(i))
(Python)
def a(x):
return ((x-3)*(x-2)*(2*x**2+(-1)**x-1))/4
(PARI) concat(vector(3), Vec(8*x^3*(2 + 5*x + 5*x^2) / ((1 - x)^5*(1 + x)^3) + O(x^50))) \\ Colin Barker, Dec 26 2016
(PARI) concat([0, 0, 0], Vec(8*x^3*(2 + 5*x + 5*x^2) / ((1 - x)^5*(1 + x)^3) + O(x^50))) \\ G. C. Greubel, Dec 26 2016
CROSSREFS
Cf. A210379 (where all elements can be repeated).
Sequence in context: A339993 A232402 A212513 * A146748 A029872 A056633
KEYWORD
nonn,easy
AUTHOR
Indranil Ghosh, Dec 26 2016
STATUS
approved