A301471 Number of ways to write n^2 as x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.
0, 1, 2, 1, 3, 4, 3, 1, 5, 4, 4, 4, 5, 4, 10, 1, 4, 7, 4, 4, 10, 4, 3, 4, 6, 6, 11, 4, 7, 10, 6, 1, 9, 5, 7, 7, 7, 6, 12, 4, 6, 12, 7, 4, 14, 4, 8, 4, 3, 8, 10, 6, 8, 13, 6, 4, 16, 8, 7, 10, 7, 6, 14, 1, 7, 11, 6, 5, 16, 9, 5, 7, 7, 7, 18, 6, 7, 14, 6, 4
Offset: 1
Keywords
Examples
a(2) = 1 with 2^2 = 1^2 + 2*0^2 + 3*2^0. a(3) = 2 with 3^2 = 2^2 + 2*1^2 + 3*2^0 = 1^2 + 2*1^2 + 3*2^1. a(4) = 1 with 4^2 = 2^2 + 2*0^2 + 3*2^2. a(1131599953) = 1 with 1131599953^2 = 316124933^2 + 2*768304458^2 + 3*2^6. a(5884015571) = 0 since there are no nonnegative integers x,y,z such that x^2 + 2*y^2 + 3*2^z = 5884015571^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[Boole[(Mod[Part[Part[f[n],i],1],8]==5||Mod[Part[Part[f[n],i],1],8]==7)&&Mod[Part[Part[f[n],i],2],2]==1],{i,1,Length[f[n]]}]==0; QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]); SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[QQ[n^2-3*2^k],Do[If[SQ[n^2-3*2^k-2x^2],r=r+1],{x,0,Sqrt[(n^2-3*2^k)/2]}]],{k,0,Log[2,n^2/3]}];tab=Append[tab,r],{n,1,80}];Print[tab]
Comments