cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A281194 Number of 2 X 2 matrices with all terms in {-n,..,0,..,n} and (sum of terms) = determinant.

This page as a plain text file.
%I A281194 #26 Jun 09 2025 20:58:47
%S A281194 1,31,111,271,479,831,1167,1711,2239,2975,3631,4687,5407,6655,7759,
%T A281194 9135,10367,12127,13231,15375,16991,19135,20879,23471,25215,27999,
%U A281194 30319,33167,35359,39167,41039,44975,47615,50975,54511,58767,61791,66239,69391
%N A281194 Number of 2 X 2 matrices with all terms in {-n,..,0,..,n} and (sum of terms) = determinant.
%H A281194 David Radcliffe, <a href="/A281194/b281194.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..186 from Indranil Ghosh).
%e A281194 For n = 3, few of the possible matrices are [-3,-3,-3,0], [-3,-3,-1,1], [-3,-3,1,2], [-3,-3,3,3], [-3,-2,-1,1], [-3,-2,3,2], [-3,-1,-3,1], [-3,-1,-2,1], [-3,-1,-1,1], [-3,-1,0,1], [-3,-1,1,1], [-3,-1,2,1], [-3,-1,3,1], [-3,0,-1,1], [2,0,0,2], [2,0,1,3], [2,1,-3,-3], [2,1,-2,-1], [2,1,-1,1], [3,3,0,3],...There are 271 possibilities.
%e A281194 Here each of the matrices M is defined as M = [a,b;c,d] where a = M[1][1], b = M[1][2], c = M[2][1], d = M[2][2]. So, a(3) = 271.
%o A281194 (Python)
%o A281194 def t(n):
%o A281194     s=0
%o A281194     for a in range(-n, n+1):
%o A281194         for b in range(-n, n+1):
%o A281194             for c in range(-n, n+1):
%o A281194                 for d in range(-n, n+1):
%o A281194                     if (a+b+c+d)==(a*d-b*c):
%o A281194                         s+=1
%o A281194     return s
%o A281194 for i in range(0, 187):
%o A281194     print(f"{i} {t(i)}")
%o A281194 (PARI) a(n)=sum(a=-n,n, sum(d=-n,n, my(t=a*d+a+d); sum(b=-n,n, if(b==-1, if(t==-1, 2*n+1, 0), my(c=(t-b)/(b+1)); denominator(c)==1 && c<=n && c>=-n)))) \\ _Charles R Greathouse IV_, Jan 17 2017
%Y A281194 Cf. A280588, A280934, A209981.
%K A281194 nonn
%O A281194 0,2
%A A281194 _Indranil Ghosh_, Jan 17 2017