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

%I #73 Jan 04 2025 22:28:44

%S 0,1,27,85,139,307,399,765,1043,1517,1889,3021,3523,5299,6269,7671,

%T 9209,12729,14179,18995,21307,24991,28303,36261,39307,47541,52833,

%U 61173,67113,82125,86601,104655,114695,128069,139213,156653,165819,194591,209753,230835,245457,283887

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

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

%e For n = 4, a few of the possible matrices are [0,1;3,3], [0,1;3,4], [0,2;1,0], [0,2;1,1], [0,2;1,2], [2,0;1,1], [2,0;2,1], [2,0;3,1], [2,0;4,1], [2,1;0,1], [4,3;1,1], [4,3;1,2], [4,3;1,4], [4,3;3,1], [4,3;3,2], [3,2;2,3], [3,2;4,1], [3,2;4,3], [3,3;0,1], [3,3;1,0], ... There are 139 possibilities. So, a(4) = 139.

%o (Python)

%o from sympy import isprime

%o def t(n):

%o s=0

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

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

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

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

%o if isprime(a*d+b*c)==True:

%o s+=1

%o return s

%o for i in range(0, 152):

%o print(f"{i} {t(i)}")

%Y Cf. A210000, A281315.

%K nonn

%O 0,3

%A _Indranil Ghosh_, Jan 20 2017