A300448 Number of the integers 4^k*m with k >= 0 and m = 1, 2, 5 such that n^2 - 4^k*m can be written as the sum of two squares.
1, 2, 4, 2, 4, 5, 4, 2, 7, 5, 6, 5, 6, 5, 5, 2, 5, 7, 6, 5, 10, 7, 5, 5, 7, 7, 6, 5, 6, 6, 7, 2, 10, 6, 8, 7, 7, 6, 6, 5, 7, 11, 5, 7, 10, 5, 6, 5, 8, 8, 9, 7, 8, 6, 6, 5, 10, 7, 5, 6, 5, 8, 7, 2, 5, 10, 8, 6, 10, 8, 7, 7, 11, 7, 7, 6, 10, 7, 5, 5
Offset: 1
Keywords
Examples
a(1) = 1 since 1^2 - 4^0*1 = 0 = 0^2 + 0^2. a(2) = 2 since 2^2 - 4^0*2 = 2 = 1^2 + 1^2 and 2^2 - 4*1 = 0 = 0^2 + 0^2. a(4) = 2 since 4^2 - 4^1*2 = 8 = 2^2 + 2^2 and 4^2 - 4^2*1 = 0 = 0^2 + 0^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..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-2018.
Crossrefs
Programs
-
Mathematica
f[n_]:=f[n]=FactorInteger[n]; g[n_]:=g[n]=Sum[If[Mod[Part[Part[f[n],i],1]-3,4]==0&&Mod[Part[Part[f[n],i],2],2]==1,1,0],{i,1,Length[f[n]]}]==0; QQ[n_]:=QQ[n]=n==0||(n>0&&g[n]); u[1]=1; u[2]=2; u[3]=5; tab={};Do[r=0;Do[If[QQ[n^2-4^k*u[m]],r=r+1],{m,1,3},{k,0,Log[4,n^2/u[m]]}];tab=Append[tab,r],{n,1,80}];Print[tab]
Comments