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.

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

This page as a plain text file.
%I A281315 #26 Mar 11 2021 18:04:42
%S A281315 0,0,13,46,83,191,272,509,687,1010,1291,2019,2364,3468,4132,5079,6072,
%T A281315 8298,9234,12189,13621,15984,18095,22965,24886,29942,33248,38385,
%U A281315 42073,51053,53882,64609,70619,78663,85424,96024,101521,118804,127940,140598,149375,172123,179424,205334,218216
%N A281315 Number of 2 X 2 matrices with all elements in {0,...,n} and prime determinant.
%H A281315 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 A281315 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 A281315 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 A281315 (Python)
%o A281315 from sympy import isprime
%o A281315 def t(n):
%o A281315     s=0
%o A281315     for a in range(n+1):
%o A281315         for d in range(n+1):
%o A281315             ad = a * d
%o A281315             for c in range(n+1):
%o A281315                 for b in range(n+1):
%o A281315                     if isprime(ad-b*c):
%o A281315                         s+=1
%o A281315     return s
%o A281315 for i in range(187):
%o A281315     print(str(i)+" "+str(t(i)))
%o A281315 (Sage)
%o A281315 def A281315(n):
%o A281315     T = Tuples([i for i in range(n+1)], 4); i = 0
%o A281315     for t in T: i += is_prime(t[0]*t[3]-t[1]*t[2])
%o A281315     return i
%o A281315 [A281315(n) for n in range(20)] # _Peter Luschny_, Jul 23 2017
%Y A281315 Cf. A210000.
%K A281315 nonn
%O A281315 0,3
%A A281315 _Indranil Ghosh_, Jan 20 2017