login
Number of 2 X 2 matrices having all terms in {-n,...,0,..,n} and positive odd determinant.
4

%I #31 Mar 03 2024 18:44:12

%S 20,84,528,1040,3060,4788,10304,14400,26100,34100,55440,69264,104468,

%T 126420,180480,213248,291924,338580,448400,512400,660660,745844,

%U 940608,1051200,1301300,1441908,1756944,1932560,2322900,2538900,3015680,3277824,3852948,4167380

%N Number of 2 X 2 matrices having all terms in {-n,...,0,..,n} and positive odd determinant.

%C For a guide to related sequences, see A210000.

%H Chai Wah Wu, <a href="/A211158/b211158.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (1, 4, -4, -6, 6, 4, -4, -1, 1).

%F From _Chai Wah Wu_, Dec 13 2016: (Start)

%F For n >= 0:

%F a(n) = A211155(n)/2.

%F a(n) = n*(n + 1)*(3*n + 1 + 3*n^2 - (-1)^n*(2*n + 1)). Therefore:

%F a(n) = n^2*(n + 1)*(3*n + 1) if n is even,

%F a(n) = n*(n + 1)^2*(3*n + 2) if n is odd.

%F a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) - 6*a(n-4) + 6*a(n-5) + 4*a(n-6) - 4*a(n-7) - a(n-8) + a(n-9) for n > 9.

%F G.f.: x*(-20*x^6 - 64*x^5 - 364*x^4 - 256*x^3 - 364*x^2 - 64*x - 20)/((x - 1)^5*(x + 1)^4). (End)

%F a(n) = a(-n-1). - _Bruno Berselli_, Dec 14 2016

%t a = -n; b = n; z1 = 25;

%t t[n_] := t[n] = Flatten[Table[w*z - x*y, {w, a, b}, {x, a, b}, {y, a, b}, {z, a, b}]]

%t c[n_, k_] := c[n, k] = Count[t[n], k]

%t u[n_] := u[n] = Sum[c[n, 2 k], {k, 0, 2*n^2}]

%t v[n_] := v[n] = Sum[c[n, 2 k], {k, 1, 2*n^2}]

%t w[n_] := w[n] = Sum[c[n, 2 k - 1], {k, 1, 2*n^2}]

%t u1 = Table[u[n], {n, 1, z1}] (* A211156 *)

%t v1 = Table[v[n], {n, 1, z1}] (* A211157 *)

%t w1 = Table[w[n], {n, 1, z1}] (* A211158 *)

%t (u1 - 1)/4 (* integers *)

%t v1/4 (* integers *)

%t w1/4 (* integers *)

%t Table[n*(n+1)*(3*n+1+3*n^2-(-1)^n*(2*n+1)),{n,35}] (* _Vincenzo Librandi_, Dec 14 2016 *)

%t CoefficientList[ Series[-(( 4(5 + 16x + 91x^2 + 64x^3 + 91x^4 + 16x^5 + 5x^6))/((x -1)^5 (x +1)^4)), {x, 0, 35}], x] (* or *)

%t LinearRecurrence[{1, 4, -4, -6, 6, 4, -4, -1, 1}, {20, 84, 528, 1040, 3060, 4788, 10304, 14400, 26100}, 36] (* _Robert G. Wilson v_, Dec 14 2016 *)

%o (Python)

%o def A211158(n):

%o return n*(n+1)*(3*n+1+3*n**2-(-1)**n*(2*n+1)) # _Chai Wah Wu_, Dec 13 2016

%o (Magma) [n*(n+1)*(3*n+1+3*n^2-(-1)^n*(2*n+1)): n in [1..35]]; // _Vincenzo Librandi_, Dec 14 2016

%Y Cf. A210000.

%K nonn,easy

%O 1,1

%A _Clark Kimberling_, Apr 05 2012