A291123 Number of ways to write 4*n+1 as (p-1)^2 + q^2 + r^2, where p is prime and q and r are nonnegative integers with q <= r.
1, 2, 2, 1, 3, 3, 1, 3, 3, 2, 5, 3, 2, 4, 2, 3, 4, 4, 2, 3, 4, 2, 4, 1, 2, 8, 4, 2, 3, 5, 3, 5, 5, 2, 4, 4, 4, 6, 5, 3, 8, 4, 3, 6, 1, 5, 7, 6, 2, 5, 6, 3, 8, 3, 3, 5, 5, 5, 4, 4, 5, 6, 3, 2, 7, 8, 4, 8, 5, 2, 8, 5, 3, 8, 7, 4, 6, 4, 3, 4, 8
Offset: 0
Keywords
Examples
a(0) = 1 since 4*0+1 = (2-1)^2 + 0^2 + 0^2 with 2 prime. a(3) = 1 since 4*3+1 = (3-1)^2 + 0^2 + 3^2 with 3 prime. a(6) = 1 since 4*6+1 = (5-1)^2 + 0^2 + 3^2 with 5 prime. a(23) = 1 since 4*23+1 = (3-1)^2 + 5^2 + 8^2 with 3 prime. a(44) = 1 since 4*44+1 = (3-1)^2 + 2^2 + 13^2 with 3 prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- 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]]; Do[r=0;Do[If[PrimeQ[p]&&SQ[4n+1-(p-1)^2-q^2],r=r+1],{p,2,Sqrt[4n+1]+1},{q,0,Sqrt[(4n+1-(p-1)^2)/2]}];Print[n," ",r],{n,0,80}]
Comments