A300441 Number of the integers 4^k*(4*u(m)^2+1) (k,m = 0,1,2,...) such that n^2 - 4^k*(4*u(m)^2+1) can be written as the sum of two squares, where u(0) = 0, u(1) = 1, and u(j+1) = 4*u(j) - u(j-1) for j = 1,2,3,....
1, 1, 2, 1, 3, 2, 1, 1, 4, 3, 3, 2, 3, 1, 3, 1, 3, 4, 4, 3, 5, 3, 3, 2, 4, 3, 3, 1, 5, 3, 3, 1, 6, 3, 4, 4, 5, 4, 4, 3, 6, 5, 4, 3, 5, 3, 4, 2, 5, 4, 5, 3, 4, 3, 5, 1, 5, 5, 3, 3, 3, 3, 5, 1, 5, 6, 3, 3, 6, 4, 4, 4, 6, 5, 5, 4, 6, 4, 5, 3
Offset: 1
Keywords
Examples
a(1) = 1 since 1^2 - 4^0*(4*u(0)^2+1) = 1 is 1^2 + 0^2. a(5) = 3 since 5^2 - 4^0*(4*u(1)^2+1) = 20 = 4^2 + 2^2, 5^2 - 4^1*(4*u(1)^2+1) = 5 = 2^2 + 1^2, and 5^2 - 4^2*(4*u(0)^2+1) = 9 = 3^2 + 0^2. a(7) = 1 since 7^2 - 4^1*(4*u(0)^2+1) = 45 = 6^2 + 3^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
u[0]=0; u[1]=1; u[n_]:=u[n]=4u[n-1]-u[n-2]; 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]); tab={};Do[r=0;Do[m=0;Label[cc];If[4u[m]^2+1>n^2/4^k,Goto[bb]];If[QQ[n^2-4^k*(4u[m]^2+1)],r=r+1,m=m+1;Goto[cc]]; Label[bb],{k,0,Log[2,n]}];tab=Append[tab,r],{n,1,80}];Print[tab]
Comments