A291047 Number of ways to write 4*n+1 as p^2 + q^2 + 8*r^2, where p is prime, and q and r are nonnegative integers.
1, 1, 3, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 5, 1, 1, 3, 2, 3, 6, 1, 3, 4, 2, 1, 1, 2, 4, 4, 5, 1, 5, 3, 3, 3, 1, 4, 9, 2, 1, 4, 3, 3, 6, 4, 2, 5, 3, 4, 5, 2, 6, 3, 3, 4, 6, 1, 4, 5, 4, 2, 8, 2, 2, 6, 1, 3, 5, 2, 3, 3, 5, 6, 8, 3, 1, 9, 4, 4
Offset: 1
Keywords
Examples
a(1) = 1 since 4*1+1 = 2^2 + 1^2 + 8*0^2 with 2 prime. a(2) = 1 since 4*2+1 = 3^2 + 0^2 + 8*0^2 with 3 prime. a(4) = 1 since 4*4+1 = 3^2 + 0^2 + 8*1^2 with 3 prime. a(16) = 1 since 4*16+1 = 7^2 + 4^2 + 8*0^2 with 7 prime. a(17) = 1 since 4*17+1 = 5^2 + 6^2 + 8*1^2 with 5 prime. a(4787) = 1 since 4*4787+1 = 31^2 + 126^2 + 8*17^2 with 31 prime. a(4822) = 1 since 4*4822+1 = 29^2 + 4^2 + 8*48^2 with 29 prime. a(11962) = 1 since 4*11962+1 = 109^2 + 160^2 + 8*36^2 with 109 prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[PrimeQ[p]&&SQ[4n+1-p^2-8q^2],r=r+1],{p,2,Sqrt[4n+1]},{q,0,Sqrt[(4n+1-p^2)/8]}]; tab=Append[tab,r];Continue,{n,1,80}]
Comments