A281090
Number of 2 X 2 matrices with all elements in {0,...,n} and prime permanent.
Original entry on oeis.org
0, 1, 27, 85, 139, 307, 399, 765, 1043, 1517, 1889, 3021, 3523, 5299, 6269, 7671, 9209, 12729, 14179, 18995, 21307, 24991, 28303, 36261, 39307, 47541, 52833, 61173, 67113, 82125, 86601, 104655, 114695, 128069, 139213, 156653, 165819, 194591, 209753, 230835, 245457, 283887
Offset: 0
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.
-
from sympy import isprime
def t(n):
s=0
for a in range(0, n+1):
for b in range(0, n+1):
for c in range(0, n+1):
for d in range(0, n+1):
if isprime(a*d+b*c)==True:
s+=1
return s
for i in range(0, 152):
print(f"{i} {t(i)}")
A281550
Number of 2 X 2 matrices with all elements in 0..n such that the sum of the elements is prime.
Original entry on oeis.org
0, 10, 46, 114, 234, 458, 826, 1370, 2090, 3010, 4174, 5658, 7534, 9930, 12954, 16662, 21074, 26242, 32246, 39182, 47186, 56386, 66874, 78798, 92290, 107434, 124282, 142942, 163550, 186266, 211250, 238626, 268526, 301134, 336610, 375086, 416678, 461454, 509434, 560662, 615182, 673106
Offset: 0
For n = 4, a few of the possible matrices are [0,4;2,1], [0,4;3,0], [0,4;3,4], [0,4;4,3], [1,0;0,1], [1,0;0,2], [1,0;0,4], [1,0;1,0], [1,0;1,1], [1,0;1,3], [2,2;3,0], [2,2;3,4], [2,2;4,3], [2,3;0,0], [2,3;0,2], [3,4;3,3], [3,4;4,0], [3,4;4,2], [4,0;0,1], [4,0;0,3], [4,0;1,0], ... There are 234 possibilities.
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(4) = 234.
-
a(n)=my(X=Pol(vector(n+1,i,1))+O('x^(4*n)),Y=X^4,s); forprime(p=2,4*n, s+=polcoeff(Y,p)); s \\ Charles R Greathouse IV, Feb 15 2017
-
from sympy import isprime
def t(n):
s=0
for a in range(0, n+1):
for b in range(0, n+1):
for c in range(0, n+1):
for d in range(0, n+1):
if isprime(a+b+c+d)==True:
s+=1
return s
for i in range(0, 201):
print(str(i)+" "+str(t(i)))
Showing 1-2 of 2 results.