A290935 Number of ways to write 2*n+1 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that p = x^2 + 3*y^2 + 5*z^2 + 7*w^2 and p - 2 are twin prime.
2, 1, 4, 2, 1, 1, 4, 2, 2, 6, 2, 1, 6, 1, 2, 8, 5, 3, 7, 1, 4, 10, 3, 2, 9, 4, 8, 7, 5, 5, 11, 4, 7, 8, 4, 3, 10, 5, 6, 10, 7, 4, 16, 4, 9, 10, 2, 3, 11, 7, 5, 8, 3, 7, 13, 4, 4, 16, 2, 6, 15, 1, 4, 10, 6, 6, 13, 7, 2, 13, 8, 9, 15, 4, 12, 8, 7, 5, 7, 2, 9
Offset: 0
Keywords
Examples
a(0) = 2 since 2*0+1 = 0^2 + 0^2 + 1^2 + 0^2 with 0^2 + 3*0^2 + 5*1^2 + 7*0^2 = 5 and 5 - 2 = 3 twin prime, and 2*0+1 = 0^2 + 0^2 + 0^2 + 1^2 with 0^2 + 3*0^2 + 5*0^2 + 7*1^2 = 7 and 7 - 2 = 5 prime. a(1) = 1 since 2*1+1 = 1^2 + 0^2 + 1^2 + 1^2 with 1^2 + 3*0^2 + 5*1^2 + 7*1^2 = 13 and 13 - 2 = 11 twin prime. a(4) = 1 since 2*4+1 = 2^2 + 0^2 + 2^2 + 1^2 with 2^2 + 3*0^2 + 5*2^2 + 7*1^2 = 31 and 31 - 2 = 29 twin prime. a(5) = 1 since 2*5+1 = 3^2 + 1^2 + 0^2 + 1^2 with 3^2 + 3*1^2 + 5*0^2 + 7*1^2 = 19 and 19 - 2 twin prime. a(11) = 1 since 2*11+1 = 3^2 + 2^2 + 3^2 + 1^2 with 3^2 + 3*2^2 + 5*3^2 + 7*1^2 = 73 and 73 - 2 = 71 twin prime. a(13) = 1 since 2*13+1 = 1^2 + 0^2 + 1^2 + 5^2 with 1^2 + 3*0^2 + 5*1^2 + 7*5^2 = 181 and 181 - 2 = 179 twin prime. a(19) = 1 since 2*19+1 = 1^2 + 3^2 + 5^2 + 2^2 with 1^2 + 3*3^2 + 5*5^2 + 7*2^2 = 181 and 181 - 2 = 179 twin prime. a(61) = 1 since 2*61+1 = 7^2 + 3^2 + 7^2 + 4^2 with 7^2 + 3*3^2 + 5*7^2 + 7*4^2 = 433 and 433 - 2 = 431 twin prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..5000
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
- Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; TQ[p_]:=TQ[p]=PrimeQ[p]&&PrimeQ[p-2]; Do[r=0;Do[If[SQ[2n+1-x^2-y^2-z^2]&&TQ[x^2+3y^2+5z^2+7(2n+1-x^2-y^2-z^2)],r=r+1],{x,0,Sqrt[2n+1]},{y,0,Sqrt[2n+1-x^2]},{z,0,Sqrt[2n+1-x^2-y^2]}];Print[n," ",r],{n,0,80}]
Comments