login
Number of 2 X 2 matrices having all terms in {1,...,n} and determinant in the closed interval [0,n].
2

%I #14 Sep 06 2024 12:40:44

%S 1,10,36,91,179,330,516,802,1150,1615,2119,2873,3595,4558,5653,6967,

%T 8245,10020,11642,13846,16053,18524,20944,24393,27405,30924,34637,

%U 39035,42961,48396,52906,58687,64326,70457,76722,84824,91318,99045

%N Number of 2 X 2 matrices having all terms in {1,...,n} and determinant in the closed interval [0,n].

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

%H Robert Israel, <a href="/A211057/b211057.txt">Table of n, a(n) for n = 1..1000</a>

%p g:= proc(n) local T,S,a,b,t,i;

%p T:= Vector(n^2):

%p for a from 1 to n do T[a^2]:= 1 od:

%p for a from 1 to n-1 do for b from a+1 to n do

%p T[a*b]:= T[a*b]+2

%p od od;

%p S:= Vector(n^2);

%p S[1]:= T[1];

%p for i from 2 to n^2 do S[i]:= S[i-1]+T[i] od;

%p t:= T[1]*S[n+1];

%p for i from 2 to n^2-n do

%p t:= t + T[i]*(S[i+n]-S[i-1])

%p od;

%p t+1

%p end proc:

%p g(1):= 1:

%p map(g, [$1..40]); # _Robert Israel_, Sep 06 2024

%t a = 1; b = n; z1 = 40;

%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 c1[n_, m_] := c1[n, m] = Sum[c[n, k], {k, 0, m}]

%t Table[c1[n, n], {n, 1, z1}]

%Y Cf. A210000.

%K nonn

%O 1,2

%A _Clark Kimberling_, Mar 31 2012