login
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.
6

%I #73 Feb 26 2018 03:07:49

%S 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,

%T 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,

%U 10,6,6,13,7,2,13,8,9,15,4,12,8,7,5,7,2,9

%N 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.

%C Conjecture: a(n) > 0 for all n = 0,1,2,..., and a(n) = 1 only for n = 1, 4, 5, 11, 13, 19, 61.

%C This refinement of Lagrange's four-square theorem implies the twin prime conjecture.

%C Below we list some similar conjectures:

%C (i) Any positive odd integer can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that p = 3*x^2 + 5*y^2 + 11*z^2 + 13*w^2 and p + 2 are twin prime.

%C (ii) Each positive odd integer can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that p = x + y + 3*z + 5*w and p + 2 (or p - 2) are twin prime.

%C (iii) Any positive odd integer can be can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x^3 + y^3 + z^3 + 3*w^3 is prime.

%C (iv) For each m = 1,2,3, any positive integer not divisible by 4 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x^m + 2*y^m + 3*z^m + 4*w^m is prime.

%C (v) Let n be any positive integer not divisible by 4. Then we can write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 2*x^4 + 3*y^4 + 4*z^4 + 5*w^4 is prime. Also, we can write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 3*x^5 + 4*y^5 + 5*z^6 + 6*w^5 is prime.

%H Zhi-Wei Sun, <a href="/A290935/b290935.txt">Table of n, a(n) for n = 0..5000</a>

%H Zhi-Wei Sun, <a href="http://dx.doi.org/10.1016/j.jnt.2016.11.008">Refining Lagrange's four-square theorem</a>, J. Number Theory 175(2017), 167-190.

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1701.05868">Restricted sums of four squares</a>, arXiv:1701.05868 [math.NT], 2017.

%e 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.

%e 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.

%e 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.

%e 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.

%e 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.

%e 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.

%e 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.

%e 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.

%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];

%t TQ[p_]:=TQ[p]=PrimeQ[p]&&PrimeQ[p-2];

%t 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}]

%Y Cf. A000040, A000118, A000290, A001359, A006512, A271518, A281976, A291150, A291191.

%K nonn

%O 0,1

%A _Zhi-Wei Sun_, Aug 23 2017