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.

A281550 Number of 2 X 2 matrices with all elements in 0..n such that the sum of the elements is prime.

This page as a plain text file.
%I A281550 #27 Jun 14 2025 10:17:45
%S A281550 0,10,46,114,234,458,826,1370,2090,3010,4174,5658,7534,9930,12954,
%T A281550 16662,21074,26242,32246,39182,47186,56386,66874,78798,92290,107434,
%U A281550 124282,142942,163550,186266,211250,238626,268526,301134,336610,375086,416678,461454,509434,560662,615182,673106
%N A281550 Number of 2 X 2 matrices with all elements in 0..n such that the sum of the elements is prime.
%H A281550 Charles R Greathouse IV, <a href="/A281550/b281550.txt">Table of n, a(n) for n = 0..10000</a> (terms 0..200 from Indranil Ghosh, terms 201..3000 from Chai Wah Wu)
%F A281550 a(n) = Sum_{p prime} Sum_{k=0..4} (-1)^k * binomial(4, k) * binomial(p+3-k*(n+1), 3). - _David Radcliffe_, Jun 13 2025
%e A281550 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.
%e A281550 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.
%o A281550 (Python)
%o A281550 from sympy import isprime
%o A281550 def t(n):
%o A281550     s=0
%o A281550     for a in range(0, n+1):
%o A281550         for b in range(0, n+1):
%o A281550             for c in range(0, n+1):
%o A281550                 for d in range(0, n+1):
%o A281550                     if isprime(a+b+c+d)==True:
%o A281550                         s+=1
%o A281550     return s
%o A281550 for i in range(0, 201):
%o A281550     print(str(i)+" "+str(t(i)))
%o A281550 (PARI) 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
%Y A281550 Cf. A210000, A281090, A281315.
%K A281550 nonn
%O A281550 0,2
%A A281550 _Indranil Ghosh_, Jan 23 2017