login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A281315 Number of 2 X 2 matrices with all elements in {0,...,n} and prime determinant. 3

%I #26 Mar 11 2021 18:04:42

%S 0,0,13,46,83,191,272,509,687,1010,1291,2019,2364,3468,4132,5079,6072,

%T 8298,9234,12189,13621,15984,18095,22965,24886,29942,33248,38385,

%U 42073,51053,53882,64609,70619,78663,85424,96024,101521,118804,127940,140598,149375,172123,179424,205334,218216

%N Number of 2 X 2 matrices with all elements in {0,...,n} and prime determinant.

%H Chai Wah Wu, <a href="/A281315/b281315.txt">Table of n, a(n) for n = 0..1000</a> (terms 0..186 from Indranil Ghosh)

%e For n = 3, a few of the possible matrices are [1,0;3,3], [1,1;0,2], [1,1;0,3], [1,1;1,3], [1,2;0,2], [1,2;0,3], [1,3;0,2], [1,3;0,3], [2,0;0,1], [2,0;1,1], [2,0;2,1], [2,0;3,1], [2,1;0,1], [2,1;1,2], [2,1;1,3], [3,1;3,2], [3,2;0,1], [3,2;1,3], [3,2;2,2], [3,2;2,3], ... There are 46 possibilities.

%e 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] and d = M[2][2]. So, a(3) = 46.

%o (Python)

%o from sympy import isprime

%o def t(n):

%o s=0

%o for a in range(n+1):

%o for d in range(n+1):

%o ad = a * d

%o for c in range(n+1):

%o for b in range(n+1):

%o if isprime(ad-b*c):

%o s+=1

%o return s

%o for i in range(187):

%o print(str(i)+" "+str(t(i)))

%o (Sage)

%o def A281315(n):

%o T = Tuples([i for i in range(n+1)], 4); i = 0

%o for t in T: i += is_prime(t[0]*t[3]-t[1]*t[2])

%o return i

%o [A281315(n) for n in range(20)] # _Peter Luschny_, Jul 23 2017

%Y Cf. A210000.

%K nonn

%O 0,3

%A _Indranil Ghosh_, Jan 20 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 7 09:20 EDT 2024. Contains 375010 sequences. (Running on oeis4.)