login
Number of nonnegative integers k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers.
2

%I #9 Apr 11 2018 03:09:31

%S 0,1,2,1,3,3,3,1,3,4,4,3,4,4,5,1,4,4,4,4,5,4,3,3,6,5,5,4,5,5,5,1,4,5,

%T 6,4,5,5,6,4,5,6,6,4,7,4,7,3,3,7,4,5,6,6,5,4,7,6,6,5,6,5,6,1,7,5,6,5,

%U 7,7,4,4,6,5,8,5,6,7,5,4

%N Number of nonnegative integers k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers.

%C The author's Square Conjecture in A301471 implies that a(n) > 0 for all n > 1.

%C We have a(2^n) = 1 for all n > 0. In fact, (2^n)^2 = (2^(n-1))^2 + 2*0^2 + 3*2^(2*n-2). If k > 2*n-2 then 3*2^k >= 6*2^(2*n-2) > (2^n)^2. If 0 <= k < 2*n-2, then 2*n-k is at least 3 and hence (2^n)^2 - 3*2^k = 2^k*(2^(2*n-k)-3) cannot be written as x^2 + 2*y^2 with x and y integers.

%H Zhi-Wei Sun, <a href="/A302641/b302641.txt">Table of n, a(n) for n = 1..10000</a>

%H Zhi-Wei Sun, <a href="http://dx.doi.org/10.1016/j.jnt.2016.11.008">Refining Lagrange's four-square theorem</a>, J. Number Theory 175(2017), 167-190.

%H Zhi-Wei Sun, <a href="http://arxiv.org/abs/1701.05868">Restricted sums of four squares</a>, arXiv:1701.05868 [math.NT], 2017-2018.

%H Zhi-Wei Sun, <a href="http://listserv.nodak.edu/cgi-bin/wa.exe?A2=NMBRTHRY;6dc436e.1804">My square conjecture with prize</a>, a message to Number Theory List, April 7, 2018.

%e a(2) = 1 with 2^2 = 1^2 + 2*0^2 + 3*2^0.

%e a(3) = 2 with 3^2 = 2^2 + 2*1^2 + 3*2^0 = 1^2 + 2*1^2 + 3*2^1.

%e a(2857932461) = 1 since 3 is the only nonnegative integer k such that 2857932461^2 - 3*2^k has the form x^2 + 2*y^2 with x and y integers.

%e a(4428524981) = 2 since 3 and 8 are the only nonnegative integers k such that 4428524981^2 - 3*2^k has the form x^2 + 2*y^2 with x and y integers.

%e a(4912451281) = 3 since 3, 6 and 7 are the only nonnegative integers k with 4428524981^2 - 3*2^k = x^2 + 2*y^2 for some integers x and y.

%t f[n_]:=f[n]=FactorInteger[n];

%t 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;

%t QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]);

%t tab={};Do[r=0;Do[If[QQ[n^2-3*2^k],r=r+1],{k,0,Log[2,n^2/3]}];tab=Append[tab,r],{n,1,80}];Print[tab]

%Y Cf. A000079, A000290, A002479, A299924, A299537, A299794, A300219, A300362, A300396, A300510, A301376, A301391, A301452, A301472, A301479, A301579, A301640.

%K nonn

%O 1,3

%A _Zhi-Wei Sun_, Apr 10 2018