[go: up one dir, main page]

login
Search: a301376 -id:a301376
     Sort: relevance | references | number | modified | created      Format: long | short | data
Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 2^c + 2^d, where a,b,c,d are nonnegative integers with a <= b and c <= d.
+10
34
0, 1, 2, 3, 4, 5, 4, 6, 7, 7, 7, 9, 7, 8, 9, 9, 8, 12, 11, 11, 11, 11, 11, 14, 11, 13, 12, 11, 10, 14, 11, 12, 17, 15, 12, 16, 14, 15, 17, 19, 15, 16, 13, 15, 17, 17, 16, 20, 16, 14, 17, 17, 14, 22, 17, 14, 14, 17, 15, 19
OFFSET
1,3
COMMENTS
Conjecture: a(n) > 0 for all n > 1. In other words, any integer n > 1 can be written as the sum of two triangular numbers and two powers of 2.
a(n) > 0 for all n = 2..10^9. See A303234 for numbers of the form x*(x+1)/2 + 2^y with x and y nonnegative integers. See also A303363 for a stronger conjecture.
In contrast, Crocker proved in 2008 that there are infinitely many positive integers not representable as the sum of two squares and at most two powers of 2.
REFERENCES
R. C. Crocker, On the sum of two squares and two powers of k, Colloq. Math. 112(2008), 235-267.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(2) = 1 with 2 = 0*(0+1)/2 + 0*(0+1)/2 + 2^0 + 2^0.
a(3) = 2 with 3 = 0*(0+1)/2 + 1*(1+1)/2 + 2^0 + 2^0 = 0*(0+1)/2 + 0*(0+1)/2 + 2^0 + 2^1.
a(4) = 3 with 4 = 1*(1+1)/2 + 1*(1+1)/2 + 2^0 + 2^0 = 0*(0+1)/2 + 1*(1+1)/2 + 2^0 + 2^1 = 0*(0+1)/2 + 0*(0+1)/2 + 2^1 + 2^1.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n], i], 1], 4]==3&&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[4(n-2^k-2^j)+1], Do[If[SQ[8(n-2^k-2^j-x(x+1)/2)+1], r=r+1], {x, 0, (Sqrt[4(n-2^k-2^j)+1]-1)/2}]], {k, 0, Log[2, n]-1}, {j, k, Log[2, n-2^k]}]; tab=Append[tab, r], {n, 1, 60}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 20 2018
STATUS
approved
Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 2^c + 2^d, where a,b,c,d are nonnegative integers with a <= b, c <= d and 2|c.
+10
33
0, 1, 2, 2, 3, 3, 2, 4, 6, 3, 5, 6, 4, 6, 7, 4, 4, 9, 6, 6, 8, 4, 9, 9, 5, 7, 7, 5, 7, 9, 4, 8, 13, 7, 6, 11, 7, 10, 13, 8, 9, 10, 7, 9, 11, 7, 9, 15, 8, 8, 14, 6, 9, 16, 6, 8, 11, 11, 10, 12, 8, 7, 15, 10, 8, 11, 9, 14, 15, 9
OFFSET
1,3
COMMENTS
Conjecture: a(n) > 0 for all n > 1.
This is stronger than the author's conjecture in A303233. I have verified a(n) > 0 for all n = 2..10^9.
In contrast, Corcker proved in 2008 that there are infinitely many positive integers not representable as the sum of two squares and at most two powers of 2.
LINKS
R. C. Crocker, On the sum of two squares and two powers of k, Colloq. Math. 112(2008), 235-267.
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(2) = 1 with 2 = 0*(0+1)/2 + 0*(0+1)/2 + 2^0 + 2^0.
a(3) = 2 with 3 = 0*(0+1)/2 + 1*(1+1)/2 + 2^0 + 2^0 = 0*(0+1)/2 + 0*(0+1)/2 + 2^0 + 2^1.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n], i], 1], 4]==3&&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[4(n-4^j-2^k)+1], Do[If[SQ[8(n-4^j-2^k-x(x+1)/2)+1], r=r+1], {x, 0, (Sqrt[4(n-4^j-2^k)+1]-1)/2}]], {j, 0, Log[4, n/2]}, {k, 2j, Log[2, n-4^j]}]; tab=Append[tab, r], {n, 1, 70}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 22 2018
STATUS
approved
Number of ways to write n as x^2 + 2*y^2 + 3*2^z + 4^w with x,y,z,w nonnegative integers.
+10
32
0, 0, 0, 1, 1, 1, 3, 3, 2, 4, 3, 2, 6, 2, 4, 8, 2, 4, 7, 3, 4, 8, 5, 5, 10, 6, 4, 10, 8, 5, 12, 7, 3, 12, 4, 5, 12, 5, 5, 14, 7, 4, 12, 7, 6, 12, 6, 6, 10, 7, 7, 12, 7, 6, 14, 6, 8, 16, 4, 8, 18, 5, 6, 16, 5, 9, 13, 7, 7, 14
OFFSET
1,7
COMMENTS
Conjecture: a(n) > 0 for all n > 3.
This is stronger than the author's previous conjecture in A302983. It has been verified that a(n) > 0 for all n = 4..10^9.
Jiao-Min Lin (a student at Nanjing University) has found a counterexample to the conjecture: a(12558941213) = 0. - Zhi-Wei Sun, Jul 30 2022
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(4) = 1 with 4 = 0^2 + 2*0^2 + 3*2^0 + 4^0.
a(5) = 1 with 5 = 1^2 + 2*0^2 + 3*2^0 + 4^0.
a(6) = 1 with 6 = 0^2 + 2*1^2 + 3*2^0 + 4^0.
a(9) = 2 with 9 = 0^2 + 2*1^2 + 3*2^0 + 4^1 = 0^2 + 2*1^2 + 3*2^1 + 4^0.
MATHEMATICA
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[MemberQ[{5, 7}, Mod[Part[Part[f[n], i], 1], 8]]&&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-3*2^k-4^j], Do[If[SQ[n-3*2^k-4^j-2x^2], r=r+1], {x, 0, Sqrt[(n-3*2^k-4^j)/2]}]], {k, 0, Log[2, n/3]}, {j, 0, If[3*2^k==n, -1, Log[4, n-3*2^k]]}]; tab=Append[tab, r], {n, 1, 70}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 22 2018
STATUS
approved
Number of ways to write n as x^2 + 5*y^2 + 2^z + 3*2^w with x,y,z,w nonnegative integers.
+10
30
0, 0, 0, 1, 2, 1, 2, 4, 3, 3, 5, 4, 6, 7, 4, 7, 5, 4, 7, 8, 5, 5, 8, 5, 9, 7, 6, 13, 10, 7, 9, 10, 7, 12, 11, 8, 11, 7, 7, 11, 11, 6, 11, 13, 6, 10, 7, 7, 17, 13, 6, 13, 14, 9, 11, 18, 10, 13, 14, 11
OFFSET
1,5
COMMENTS
Conjecture: a(n) > 0 for all n > 3.
Clearly, a(4*n) > 0 if a(n) > 0. We have verified a(n) > 0 for all n = 4..2*10^8.
See also A302983 and A302984 for similar conjectures.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(4) = 1 with 4 = 0^2 + 5*0^2 + 2^0 + 3*2^0.
a(5) = 2 with 5 = 1^2 + 5*0^2 + 2^0 + 3*2^0 = 0^2 + 5*0^2 + 2^1 + 3*2^0.
a(6) = 1 with 6 = 1^2 + 3*0^2 + 2^1 + 3*2^0.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
tab={}; Do[r=0; Do[If[SQ[n-3*2^k-2^j-5x^2], r=r+1], {k, 0, Log[2, n/3]}, {j, 0, If[n==3*2^k, -1, Log[2, n-3*2^k]]}, {x, 0, Sqrt[(n-3*2^k-2^j)/5]}]; tab=Append[tab, r], {n, 1, 60}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 16 2018
STATUS
approved
Number of ways to write n as x^2 + 2*y^2 + 2^z + 5*2^w with x,y,z,w nonnegative integers.
+10
30
0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 3, 4, 5, 5, 8, 5, 5, 7, 4, 6, 7, 9, 9, 10, 10, 7, 9, 8, 10, 15, 10, 9, 10, 8, 6, 10, 10, 11, 14, 14, 8, 12, 13, 13, 20, 15, 12, 16, 10, 15, 12, 10, 15, 17, 16, 12, 16, 14, 14, 21
OFFSET
1,7
COMMENTS
Conjecture: a(n) > 0 for all n > 5.
Clearly, a(2*n) > 0 if a(n) > 0. We have verified a(n) > 0 for all n = 6...10^9.
See also A302982 and A302983 for similar conjectures.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(6) = 1 with 6 = 0^2 + 2*0^2 + 2^0 + 5*2^0.
a(7) = 2 with 7 = 1^2 + 2*0^2 + 2^0 + 5*2^0 = 0^2 + 2*0^2 + 2^1 + 5*2^0.
a(8) = 2 with 8 = 0^2 + 2*1^2 + 2^0 + 5*2^0 = 1^2 + 2*0^2 + 2^1 + 5*2^0.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[MemberQ[{5, 7}, Mod[Part[Part[f[n], i], 1], 8]]&&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-5*2^k-2^j], Do[If[SQ[n-5*2^k-2^j-2x^2], r=r+1], {x, 0, Sqrt[(n-5*2^k-2^j)/2]}]], {k, 0, Log[2, n/5]}, {j, 0, Log[2, Max[1, n-5*2^k]]}]; tab=Append[tab, r], {n, 1, 60}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 16 2018
STATUS
approved
Numbers of the form x*(x+1)/2 + 2^y with x and y nonnegative integers.
+10
30
1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 22, 23, 25, 26, 29, 30, 31, 32, 33, 35, 36, 37, 38, 40, 42, 44, 46, 47, 49, 52, 53, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 70, 71, 74, 77, 79, 80
OFFSET
1,2
COMMENTS
Conjecture: Any integer n > 1 can be written as the sum of two terms of the current sequence.
This is equivalent to the author's conjecture in A303233.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(1) = 1 with 1 = 0*(0+1)/2 + 2^0.
a(2) = 2 with 2 = 1*(1+1)/2 + 2^0 = 0*(0+1)/2 + 2^1.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
tab={}; Do[Do[If[SQ[8(n-2^k)+1], tab=Append[tab, n]; Goto[aa]], {k, 0, Log[2, n]}]; Label[aa], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 20 2018
STATUS
approved
Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 5^c + 5^d, where a,b,c,d are nonnegative integers with a <= b and c <= d.
+10
30
0, 1, 1, 1, 1, 2, 1, 3, 2, 2, 2, 4, 3, 2, 2, 3, 3, 3, 2, 2, 2, 4, 3, 2, 1, 5, 4, 3, 2, 5, 5, 5, 5, 3, 3, 5, 5, 4, 4, 4, 5, 5, 2, 5, 3, 5, 4, 7, 2, 4, 6, 6, 5, 4, 4, 5, 8, 4, 4, 4, 7, 6, 4, 3, 4, 8, 4, 7, 3, 3, 6, 8, 2, 5, 6, 5, 4, 6, 4, 3
OFFSET
1,6
COMMENTS
Conjecture: a(n) > 0 for all n > 1. In other words, any integers n > 1 can be written as the sum of two triangular numbers and two powers of 5.
This has been verified for all n = 2..10^10.
See A303393 for the numbers of the form x*(x+1)/2 + 5^y with x and y nonnegative integers.
See also A303401, A303432 and A303540 for similar conjectures.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(4) = 1 with 4 = 1*(1+1)/2 + 1*(1+1)/2 + 5^0 + 5^0.
a(5) = 1 with 5 = 0*(0+1)/2 + 2*(2+1)/2 + 5^0 + 5^0.
a(7) = 1 with 7 = 0*(0+1)/2 + 1*(1+1)/2 + 5^0 + 5^1.
a(25) = 1 with 25 = 0*(0+1)/2 + 5*(5+1)/2 + 5^1 + 5^1.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n], i], 1], 4]==3&&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[4(n-5^j-5^k)+1], Do[If[SQ[8(n-5^j-5^k-x(x+1)/2)+1], r=r+1], {x, 0, (Sqrt[4(n-5^j-5^k)+1]-1)/2}]], {j, 0, Log[5, n/2]}, {k, j, Log[5, n-5^j]}]; tab=Append[tab, r], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 23 2018
STATUS
approved
Numbers of the form x*(x+1)/2 + 5^y with x and y nonnegative integers.
+10
29
1, 2, 4, 5, 6, 7, 8, 11, 15, 16, 20, 22, 25, 26, 28, 29, 31, 33, 35, 37, 40, 41, 46, 50, 53, 56, 60, 61, 67, 70, 71, 79, 80, 83, 91, 92, 96, 103, 106, 110, 116, 121, 125, 126, 128, 130, 131, 135, 137, 140, 141, 145, 146, 153, 154, 158, 161, 170, 172, 176
OFFSET
1,2
COMMENTS
The author's conjecture in A303389 has the following equivalent version: Each integer n > 1 can be expressed as the sum of two terms of the current sequence.
This has been verified for all n = 2..2*10^8.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(1) = 1 with 1 = 0*(0+1)/2 + 5^0.
a(2) = 2 with 2 = 1*(1+1)/2 + 5^0.
a(3) = 4 with 4 = 2*(2+1)/2 + 5^0.
MATHEMATICA
TQ[n_]:=TQ[n]=IntegerQ[Sqrt[8n+1]];
tab={}; Do[Do[If[TQ[m-5^k], tab=Append[tab, m]; Goto[aa]], {k, 0, Log[5, m]}]; Label[aa], {m, 1, 176}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 23 2018
STATUS
approved
Number of ordered pairs (a, b) with 0 <= a <= b such that n - 5^a - 5^b can be written as the sum of two triangular numbers.
+10
27
0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2, 2, 1, 4, 3, 3, 2, 5, 4, 4, 4, 3, 3, 4, 4, 3, 4, 4, 4, 3, 2, 4, 3, 3, 3, 5, 2, 4, 5, 4, 4, 4, 4, 3, 5, 3, 4, 4, 4, 4, 4, 3, 3, 5, 4, 5, 3, 3, 5, 5, 2, 4, 6, 3, 3, 4, 4, 3
OFFSET
1,6
COMMENTS
Conjecture: a(n) > 0 for all n > 1.
This is equivalent to the author's conjecture in A303389. It has been verified that a(n) > 0 for all n = 2..6*10^9.
Note that a nonnegative integer m is the sum of two triangular numbers if and only if 4*m + 1 can be written as the sum of two squares.
LINKS
Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Zhi-Wei Sun, New conjectures on representations of integers (I), Nanjing Univ. J. Math. Biquarterly 34(2017), no. 2, 97-120.
Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
EXAMPLE
a(6) = 2 with 6 - 5^0 - 5^0 = 1*(1+1)/2 + 2*(2+1)/2 and 6 - 5^0 - 5^1 = 0*(0+1)/2 + 0*(0+1)/2.
a(7) = 1 with 7 - 5^0 - 5^1 = 0*(0+1)/2 + 1*(1+1)/2.
a(25) = 1 with 25 - 5^1 - 5^1 = 0*(0+1)/2 + 5*(5+1)/2.
MATHEMATICA
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n], i], 1], 4]==3&&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[4(n-5^j-5^k)+1], r=r+1], {j, 0, Log[5, n/2]}, {k, j, Log[5, n-5^j]}]; tab=Append[tab, r], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Apr 23 2018
STATUS
approved
Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and y even such that x^2 - (6*y)^2 = 4^k for some k = 0,1,2,....
+10
25
1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 3, 4, 1, 1, 8, 2, 2, 2, 3, 2, 6, 1, 2, 2, 1, 1, 11, 3, 2, 4, 4, 3, 3, 1, 6, 10, 6, 2, 7, 2, 3, 2, 6, 3, 8, 2, 7, 7, 2, 1, 11, 4, 4, 2, 2, 1, 6, 1, 3, 11, 3, 3, 16, 3, 5, 4, 8, 5, 2, 3, 11, 5, 8, 1
OFFSET
1,3
COMMENTS
Conjecture: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 11, 13, 19, 2^k*m (k = 0,1,2,... and m = 1, 5, 7, 31).
We have verified a(n) > 0 for all n = 1..10^7.
See also A301376 for a similar conjecture.
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 since 2^2 = 2^2 + 0^2 + 0^2 + 0^2 with 2^2 - (6*0)^2 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4^2 - (6*0)^2 = 4^2.
a(7) = 1 since 7^2 = 2^2 + 0^2 + 3^2 + 6^2 with 2^2 - (6*0)^2 = 4^1.
a(11) = 1 since 11 = 2^2 + 0^2 + 6^2 + 9^2 with 2^2 - (6*0)^2 = 4^1.
a(13) = 1 since 13 = 4^2 + 0^2 + 3^2 + 12^2 with 4^2 - (6*0)^2 = 4^2.
a(19) = 1 since 19 = 1^2 + 0^2 + 6^2 + 18^2 with 1^2 - (6*0)^2 = 4^0.
a(31) = 1 since 31^2 = 20^2 + 2^2 + 14^2 + 19^2 with 20^2 - (6*2)^2 = 4^4.
a(75) = 2 since 75^2 = 68^2 + 10^2 + 1^2 + 30^2 = 68^2 + 10^2 + 15^2 + 26^2 with 68^2 - (6*10)^2 = 4^5.
MATHEMATICA
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n], i], 1]-3, 4]==0&&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[SQ[4^k+144m^2]&&QQ[n^2-4^k-148m^2], Do[If[SQ[n^2-(4^k+148m^2)-z^2], r=r+1], {z, 0, Sqrt[(n^2-4^k-148m^2)/2]}]], {k, 0, Log[2, n]}, {m, 0, Sqrt[(n^2-4^k)/148]}]; tab=Append[tab, r], {n, 1, 80}]; Print[tab]
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 20 2018
STATUS
approved

Search completed in 0.016 seconds