login
Search: a301579 -id:a301579
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of ways to write n^2 as x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.
+10
25
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,3
COMMENTS
Square Conjecture: a(n) > 0 for all n > 1. Moreover, for any integer n > 3 we can write n^2 as x^2 + 2*y^2 + 3*2^z, where x,y,z are nonnegative integers with y even and z > 1.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).
See also A301472 for the list of positive integers not of the form x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.
If n^2 = x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers, then it is easy to see that x is not divisible by 3.
The Square Conjecture implies that for each n = 1,2,3,... we can write 3*n^2 as x^2 + 2*y^2 + 2^z with x,y,z nonnegative integers. In fact, if (3*n)^2 = u^2 + 2*v^2 + 3*2^z with u,v,z integers and z >= 0, then u^2 == v^2 (mod 3) and thus we may assume u == v (mod 3) without loss of generality, hence 3*n^2 = (u^2+2*v^2)/3 + 2^z = x^2 + 2*y^2 + 2^z with x = (u+2*v)/3 and y = (u-v)/3 integers.
On March 25, 2018 Qing-Hu Hou at Tianjin Univ. finished his verification of the Square Conjecture for n <= 4*10^8. Then I used Hou's program to verify the conjecture for n <= 5*10^9. - Zhi-Wei Sun, Apr 10 2018
I have found a counterexample to the Square Conjecture, namely a(5884015571) = 0. Note that 5884015571 is the product of the three primes 7, 17 and 49445509. - Zhi-Wei Sun, Apr 15 2018
LINKS
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.
EXAMPLE
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.
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]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 21 2018
STATUS
approved
Largest integer k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers, or -1 if no such k exists.
+10
5
-1, 0, 1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 6, 7, 7, 7, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 8, 9, 9, 9, 9, 8, 9, 9, 7, 9, 7, 9, 9, 8, 9, 10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 10, 9, 10, 10, 10
OFFSET
1,4
COMMENTS
Conjecture: a(n) > 0.6*log_2(log_2 n) for all n > 2, and also lim inf_{n->infinity} a(n)/(log n) = 0.
The author's Square Conjecture in A301471 would imply that a(n) >= 0 for all n > 1. We have verified that a(n) > 0.6*log_2(log_2 n) for all n = 3..4*10^9. For n = 2857932461, we have a(n) = 3 and 0.603 < a(n)/log_2(log_2 n) < 0.604.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).
LINKS
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.
EXAMPLE
a(2) = 0 since 2^2 - 3*2^0 = 1^2 + 2*0^2.
a(3) = 1 since 3^2 - 3*2^1 = 2^2 + 2*1^2.
a(5) = 3 since 5^2 - 3*2^3 = 1^2 + 2*0^2.
a(6434567) = 10 since 6434567^2 - 3*2^10 = 5921293^2 + 2*1780722^2.
MAPLE
f:= proc(n) local k, t;
for k from floor(log[2](n^2/3)) by -1 to 0 do
if g(n^2 - 3*2^k) then return k fi
od;
-1
end proc:
map(f, [$1..100]); # Robert Israel, Mar 26 2018
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]);
tab={}; Do[Do[If[QQ[n^2-3*2^(Floor[Log[2, n^2/3]]-k)], tab=Append[tab, Floor[Log[2, n^2/3]]-k]; Goto[aa]], {k, 0, Log[2, n^2/3]}]; tab=Append[tab, -1]; Label[aa], {n, 1, 70}]; Print[tab]
KEYWORD
sign
AUTHOR
Zhi-Wei Sun, Mar 25 2018
STATUS
approved
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.
+10
2
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, 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, 7, 7, 4, 4, 6, 5, 8, 5, 6, 7, 5, 4
OFFSET
1,3
COMMENTS
The author's Square Conjecture in A301471 implies that a(n) > 0 for all n > 1.
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.
LINKS
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.
Zhi-Wei Sun, My square conjecture with prize, a message to Number Theory List, April 7, 2018.
EXAMPLE
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(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.
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.
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.
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]);
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]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 10 2018
STATUS
approved
Number of ways to write 3*n^2 as x^2 + 10*y^2 + 2^z, where x, y and z are nonnegative integers with z > 3.
+10
1
0, 0, 1, 1, 2, 2, 3, 3, 3, 2, 4, 4, 4, 4, 4, 4, 6, 4, 4, 3, 5, 4, 4, 5, 7, 5, 4, 4, 6, 4, 7, 5, 5, 7, 7, 5, 5, 4, 8, 5, 7, 6, 11, 6, 6, 5, 8, 5, 6, 7, 5, 7, 6, 5, 5, 5, 7, 7, 4, 4, 8, 8, 8, 6, 6, 6, 9, 8, 8, 7, 8, 6, 10, 6, 10, 6, 8, 8, 8, 5
OFFSET
1,5
COMMENTS
It might seem that a(n) > 0 for all n > 2. However, we find that a(323525083) = 0, moreover 3*323525083^2 cannot be written as x^2 + 10*y^2 + 2^z with x,y,z nonnegative integers. We note also that a(270035155) = 0 but 3*270035155^2 - 2^0 has the form x^2 + 10*y^2 with x and y integers.
My way to check whether 3*n^2 can be written as x^2 + 10*y^2 + 2^z is to find z such that 3*n^2 - 2^z can be written as x^2 + 10*y^2. I observe that a positive integer n has the form x^2 + 10*y^2 with x and y integers if and only if the p-adic order ord_p(n) of n is even for any prime p == 3, 17, 21, 27, 29, 31, 33, 39 (mod 40) and the sum of those ord_p(n) with p prime and p == 2, 5, 7, 13, 23, 37 (mod 40) is even.
From David A. Corneth, Mar 27 2018: (Start)
If a(n) > 0 then a(2*n) > 0; 3*n^2 = x^2 + 10*y^2 + 2^z <=> 3*(2*n)^2 = 4 * 3*n^2 = 4 * (x^2 + 10*y^2 + 2^z) = (2*x)^2 + 10 * (2*y)^2 + 2^(z + 2).
So we just need to check odd n and as z > 0, 2 | 2^z and furthermore 2 | 10 * y^2 so 3*x^2 must be odd, i.e., x must be odd for 3*n^2 to be odd. Also, y must be odd. For odd n, 3*n^2 == 3 (mod 4), for odd x, x^2 == (1 mod 4), for z >= 3, 2^z == 0 (mod 4) so 10 * y^2 must be == 2 (mod 4) which happens if and only if y is odd. (End)
LINKS
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.
EXAMPLE
a(1) = a(2) = 0 since 3*1^2 < 3*2^2 < 2^4.
a(3) = 1 since 3*3^2 = 1^2 + 10*1^2 + 2^4.
a(4) = 1 since 3*4^2 = 4^2 + 10*0^2 + 2^5.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
tab={}; Do[r=0; Do[If[SQ[3*n^2-2^k-10x^2], r=r+1], {k, 4, Log[2, 3n^2]}, {x, 0, (3*n^2-2^k)/10}]; tab=Append[tab, r], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 27 2018
STATUS
approved
Number of ways to write 2*n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 3*y + 5*z + 15*w is a power of 4.
+10
1
2, 1, 1, 2, 3, 1, 2, 1, 3, 1, 2, 1, 6, 3, 8, 2, 5, 4, 6, 3, 4, 3, 6, 1, 3, 3, 7, 2, 8, 9, 8, 1, 15, 5, 8, 3, 11, 1, 5, 1, 4, 4, 2, 2, 10, 7, 17, 1, 18, 11, 14, 6, 16, 6, 17, 3, 21, 10, 16, 8, 19, 8, 30, 2, 15, 9, 18, 5, 28, 5, 27, 4, 13, 11, 24, 6, 28, 17, 20, 3
OFFSET
1,1
COMMENTS
Conjecture 1: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 4^k*m with k = 0,1,2,... and m = 2, 3, 6, 10, 38.
Conjecture 2: For any positive integer n, we can write 2*n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 3*y + 5*z + 15*w is twice a power of 4.
LINKS
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.
EXAMPLE
a(1) = 2 since 2*1^2 = 1^2 + 1^2 + 0^2 + 0^2 with 1 + 3*1 + 5*0 + 15*0 = 4, and 2*1^2 = 1^2 + 0^2 + 0^2 + 1^2 with 1 + 3*0 + 5*0 + 15*1 = 4^2.
a(2) = 1 since 2*2^2 = 0^2 + 2^2 + 2^2 + 0^2 with 0 + 3*2 + 5*2 + 15*0 = 4^2.
a(3) = 1 since 2*3^2 = 1^2 + 1^2 + 0^2 + 4^2 with 1 + 3*1 + 5*0 + 15*4 = 4^3.
a(6) = 1 since 2*6^2 = 0^2 + 8^2 + 2^2 + 2^2 with 0 + 3*8 + 5*2 + 15*2 = 4^3.
a(10) = 1 since 2*10^2 = 10^2 + 8^2 + 6^2 + 0^2 with 10 + 3*8 + 5*6 + 15*0 = 4^3.
a(38) = 1 since 2*38^2 = 34^2 + 34^2 + 24^2 + 0^2 with 34 + 3*34 + 5*24 + 15*0 = 4^4.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
Pow[n_]:=Pow[n]=IntegerQ[Log[4, n]]
tab={}; Do[r=0; Do[If[SQ[2n^2-x^2-y^2-z^2]&&Pow[x+3y+5z+15*Sqrt[2n^2-x^2-y^2-z^2]], r=r+1], {x, 0, Sqrt[2]n}, {y, 0, Sqrt[2n^2-x^2]}, {z, 0, Sqrt[2n^2-x^2-y^2]}]; tab=Append[tab, r], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 28 2018
STATUS
approved

Search completed in 0.006 seconds