cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 16 results. Next

A299924 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 2*y + 3*z is a power of 4 (including 4^0 = 1).

Original entry on oeis.org

1, 1, 1, 1, 3, 4, 1, 1, 2, 2, 1, 2, 1, 1, 3, 1, 1, 11, 4, 6, 7, 7, 8, 4, 4, 6, 14, 4, 6, 17, 10, 1, 10, 6, 10, 7, 4, 4, 16, 2, 3, 10, 2, 1, 9, 6, 3, 2, 1, 5, 2, 3, 7, 9, 3, 1, 6, 2, 3, 7, 1, 4, 4, 1, 3, 4, 3, 1, 13, 20
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 21 2018

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 3, 7, 13, 49, 61, 4^k*m (k = 0,1,2,... and m = 1, 2, 11, 14, 17).
(ii) Let a,b,c,d be nonnegative integers with a >= b >= c >= d, b positive, and gcd(a,b,c,d) not divisible by 4. Then, any positive square can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that a*x + b*y + c*z + d*w = 4^k for some k = 0,1,2,..., if and only if d = 0 and (a,b,c) is among the following ordered triples: (3,2,1), (2,1,0), (3,1,0), (4,2,0), (8,1,0), (15,1,0) and (16,2,0).
By Theorem 1.1(i) of arXiv:1701.05868, any positive square can be written as (4^k)^2 + x^2 + y^2 + z^2 with k,x,y,z nonnegative integers.
We have verified that a(n) > 0 for all n = 1..50000.

Examples

			a(1) = 1 since 1^2 = 1^2 + 0^2 + 0^2 + 0^2 with 1 + 2*0 + 3*0 = 4^0.
a(2) = 1 since 2^2 = 0^2 + 2^2 + 0^2 + 0^2 with 0 + 2*2 + 3*0 = 4.
a(3) = 1 since 3^2 = 2^2 + 1^2 + 0^2 + 2^2 with 2 + 2*1 + 3*0 = 4.
a(7) = 1 since 7^2 = 2^2 + 4^2 + 2^2 + 5^2 with 2 + 2*4 + 3*2 = 4^2.
a(11) = 1 since 11^2 = 2^2 + 1^2 + 4^2 + 10^2 with 2 + 2*1 + 4*3 = 4^2.
a(13) = 1 since 13^2 = 8^2 + 1^2 + 2^2 + 10^2 with 8 + 2*1 + 3*2 = 4^2.
a(14) = 1 since 14^2 = 4^2 + 6^2 + 0^2 + 12^2 with 4 + 2*6 + 3*0 = 4^2.
a(17) = 1 since 17^2 = 0^2 + 8^2 + 0^2 + 15^2 with 0 + 2*8 + 4*0 = 4^2.
a(49) = 1 since 49^2 = 22^2 + 3^2 + 12^2 + 42^2 with 22 + 2*3 + 3*12 = 4^3.
a(61) = 1 since 61^2 = 6^2 + 20^2 + 6^2 + 57^2 with 6 + 2*20 + 3*6 = 4^3.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]];
    Do[r=0;Do[If[SQ[n^2-x^2-y^2-z^2]&&Pow[x+2y+3z],r=r+1],{x,0,n},{y,0,Sqrt[n^2-x^2]},{z,0,Sqrt[n^2-x^2-y^2]}];Print[n," ",r],{n,1,70}]

A300219 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that both x and 4*x - 3*y are powers of 4 (including 4^0 = 1).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 1, 5, 2, 2, 1, 3, 3, 1, 1, 2, 2, 2, 1, 8, 3, 2, 3, 4, 3, 4, 2, 8, 5, 4, 1, 7, 6, 4, 5, 1, 3, 6, 2, 9, 6, 3, 2, 8, 4, 2, 1, 5, 3, 7, 3, 4, 6, 3, 3, 7, 4, 5, 1, 3, 5, 3, 1, 2, 9, 4, 2, 11, 3, 6, 2, 6, 7, 3, 2, 4, 5, 4, 1
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 28 2018

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 4^k*m (k = 0,1,2,... and m = 1, 2, 3, 5, 15, 37, 83, 263). Also, for each n = 2,3,... we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and 4*x - 3*y lie in the set {2^(2k+1): k = 0,1,...}.
(ii) Let r be 0 or 1, and let n > r. Then n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and x + 3*y belong to the set {2^(2k+r): k = 0,1,2,...}, unless n has the form 2^(2k+r)*81503 with k a nonnegative integer and hence n^2 = (2^(2k+r)*28^2)^2 + (2^(2k+r)*80)^2 + (2^(2k+r)*55937)^2 + (2^(2k+r)*59272)^2 with 2^(2k+r)*28^2 = 2^r*(2^k*28)^2 and 2^(2k+r)*28^2 + 3*(2^(2k+r)*80) = 2^(2(k+5)+r). So we always can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x/2^r is a square and (x+3*y)/2^r is a power of 4.
In arXiv:1701.05868 the author proved that for each r = 0,1 and n > r we can write n^2 as (2^(2k+r))^2 + x^2 + y^2 + z^2 with k,x,y,z nonnegative integers.
We have verified both parts of the conjecture for n up to 10^7.

Examples

			a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 4*1 - 3*1 = 4^0.
a(3) = 1 since 3^2 = 1^2 + 0^2 + 2^2 + 2^2 with 1 = 4^0 and 4*1 - 3*0 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4*4 - 3*0 = 4^2.
a(15) = 1 since 15^2 = 4^2 + 4^2 + 7^2 + 12^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1.
a(37) = 1 since 37^2 = 16^2 + 16^2 + 4^2 + 29^2 with 16 = 4^2 and 4*16 - 3*16 = 4^2.
a(83) = 1 since 83^2 = 4^2 + 4^2 + 56^2 + 61^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1.
a(263) = 1 since 263^2 = 4^2 + 5^2 + 22^2 + 262^2 with 4 = 4^1 and 4*4 - 3*5 = 4^0.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Do[r=0;Do[If[SQ[n^2-16^k-((4^(k+1)-4^m)/3)^2-z^2],r=r+1],{k,0,Log[4,n]},{m,Ceiling[Log[4,Max[1,4^(k+1)-3*Sqrt[n^2-16^k]]]],k+1},{z,0,Sqrt[(n^2-16^k-((4^(k+1)-4^m)/3)^2)/2]}];Print[n," ",r];Label[aa],{n,1,80}]

A299537 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that x or y is a power of 4 (including 4^0 = 1) and x + 3*y is also a power of 4.

Original entry on oeis.org

1, 1, 1, 1, 1, 4, 1, 1, 4, 3, 1, 1, 2, 6, 1, 1, 2, 3, 1, 1, 8, 6, 2, 4, 3, 8, 3, 1, 6, 8, 4, 1, 6, 10, 3, 4, 2, 5, 6, 3, 4, 8, 1, 1, 7, 5, 1, 1, 5, 6, 4, 2, 4, 13, 5, 6, 7, 5, 5, 1, 3, 7, 2, 1, 3, 12, 6, 2, 11, 5, 5, 3, 7, 11, 2, 1, 6, 13, 5, 1
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 04 2018

Keywords

Comments

Conjecture (i): a(n) > 0 for all n > 0, and a(n) = 1 only for n = 4^k*m with k = 0,1,2,... and m = 1, 2, 3, 5, 7, 11, 15, 19, 43, 47, 135, 1103.
Conjecture (ii): For any integer n > 1, we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 2*x or 2*y is a power of 4 and 2*(x+3*y) is also a power of 4.
Note that 81503^2 cannot be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and both x and x + 3*y in the set {4^k: k = 0,1,2,...}. However, 81503^2 = 16372^2 + 4^2 + 52372^2 + 60265^2 with 4 = 4^1 and 16372 + 3*4 = 4^7.
We have verified that the conjecture for n up to 10^7.
See also the related comments in A300219 and A300360, and a similar conjecture in A299794.

Examples

			a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 1 + 3*1 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4 + 3*0 = 4^1.
a(19) = 1 since 19^2 = 1^2 + 0^2 + 6^2 + 18^2 with 1 = 4^0 and 1 + 3*0 = 4^0.
a(43) = 1 since 43^2 = 4^2 + 20^2 + 8^2 + 37^2 with 4 = 4^1 and 4 + 3*20 = 4^3.
a(135) = 1 since 135^2 = 16^2 + 16^2 + 17^2 + 132^2 with 16 = 4^2 and 16 + 3*16 = 4^3.
a(1103) = 1 since 1103^2 = 4^2 + 4^2 + 716^2 + 839^2 with 4 = 4^1 and 4 + 3*4 = 4^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]];
    tab={};Do[r=0;Do[If[(Pow[y]||Pow[4^k-3y])&&SQ[n^2-y^2-(4^k-3y)^2-z^2],r=r+1],{k,0,Log[4,Sqrt[10]*n]},{y,0,Min[n,4^k/3]},{z,0,Sqrt[Max[0,(n^2-y^2-(4^k-3y)^2)/2]]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A300396 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that 2*x or y is a power of 4 (including 4^0 = 1) and x + 63*y = 2^(2k+1) for some k = 0,1,2,....

Original entry on oeis.org

0, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 3, 1, 3, 4, 2, 2, 4, 1, 2, 1, 1, 2, 4, 3, 1, 1, 2, 1, 6, 2, 2, 2, 5, 1, 4, 1, 2, 6, 3, 3, 3, 1, 2, 3, 4, 3, 3, 2, 4, 2, 2, 1, 7, 3, 1, 4, 1, 2, 8, 1, 3, 7, 3, 4, 6, 3, 4, 4, 6, 4, 3, 2, 4, 3, 1, 2
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 05 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1, and a(n) = 1 only for n = 5, 13, 25, 29, 59, 61, 79, 91, 95, 101, 103, 1315, 2^k (k = 1,2,3,...), 2^(2k+1)*m (k = 0,1,2,... and m = 3, 5, 7, 11, 15, 19, 23, 887).
This is stronger than the conjecture that A300360(n) > 0 for all n > 1. Note that a(387) = 3 < A300360(387) = 4 and a(1774) = 1 < A300360(1774) = 2.
We have verified that a(n) > 0 for all n = 2..10^7.
See also A299537, A299794 and A300219 for similar conjectures.

Examples

			a(29) = 1 since 29^2 = 2^2 + 2^2 + 7^2 + 28^2 with 2*2 = 4^1 and 2 + 63*2 = 2^7.
a(86) = 2 since 65^2 + 1^2 + 19^2 + 53^2 = 65^2 + 1^2 + 31^2 + 47^2 with 1 = 4^0 and 65 + 63*1 = 2^7.
a(1774) = 1 since 1774^2 = 8^2 + 520^2 + 14^2 + 1696^2 with 2*8 = 4^2 and 8 + 63*520 = 2^15.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]];
    tab={};Do[r=0;Do[If[Pow[y]||Pow[(2*4^k-63y)/2],Do[If[SQ[n^2-y^2-(2*4^k-63y)^2-z^2],r=r+1],{z,0,Sqrt[Max[0,(n^2-y^2-(2*4^k-63y)^2)/2]]}]],{k,0,Log[4,Sqrt[63^2+1]*n/2]},{y,0,Min[n,2*4^k/63]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A338094 Number of ways to write 2*n + 1 as x^2 + y^2 + z^2 + w^2 with x + y a positive power of two, where x, y, z, w are nonnegative integers with x <= y and z <= w.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 2, 3, 2, 3, 1, 2, 3, 3, 1, 5, 3, 2, 3, 5, 2, 5, 3, 4, 4, 4, 3, 6, 4, 3, 4, 5, 3, 7, 2, 4, 6, 5, 2, 6, 3, 3, 4, 7, 3, 6, 4, 4, 5, 5, 2, 7, 2, 2, 3, 5, 4, 6, 4, 4, 4, 6, 3, 9, 4, 5, 6, 5, 3, 7, 2, 5, 7, 7, 4, 10, 7, 6, 7, 9, 3, 8, 3, 4, 7, 7, 5, 10, 6, 5, 6, 10, 6, 11, 5, 5, 9, 5, 3, 12
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 09 2020

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Moreover, any integer m > 1987 not congruent to 0 or 6 modulo 8 can be written as x^2 + y^2 + z^2 + w^2 with x, y, z, w nonnegative integers and x + y a positive power of 4.
We have verified the latter version of the conjecture for m up to 3*10^7.
By Theorem 1.1(ii) of the author's IJNT paper, any positive integer can be written as x^2 + y^2 + z^2 + w^2 with x, y, z, w nonnegative integers and x - y a power of two (including 2^0 = 1).
See also A338121 for related information, and A338095 and A338096 for similar conjectures.

Examples

			a(1) = 1, and 2*1 + 1 = 1^2 + 1^2 + 0^2 + 1^2 with 1 + 1 = 2^1.
a(2) = 1, and 2*2 + 1 = 0^2 + 2^2 + 0^2 + 1^2 with 0 + 2 = 2^1.
a(3) = 1, and 2*3 + 1 = 1^2 + 1^2 + 1^2 + 2^2 with 1 + 1 = 2^1.
a(11) = 1, and 2*11 + 1 = 1^2 + 3^2 + 2^2 + 3^2 with 1 + 3 = 2^2.
a(15) = 1, and 2*15 + 1 = 1^2 + 1^2 + 2^2 + 5^2 with 1 + 1 = 2^1.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    PQ[n_]:=PQ[n]=n>1&&IntegerQ[Log[2,n]];
    tab={};Do[r=0;Do[If[SQ[2n+1-x^2-y^2-z^2]&&PQ[x+y],r=r+1],{x,0,Sqrt[(2n+1)/2]},{y,x,Sqrt[2n+1-x^2]},{z,Boole[x+y==0],Sqrt[(2n+1-x^2-y^2)/2]}];
    tab=Append[tab,r],{n,1,100}];Print[tab]

A338096 Number of ways to write 2*n+1 as x^2 + y^2 + z^2 + w^2 with x + 2*y + 3*z a positive power of two, where x, y, z, w are nonnegative integers.

Original entry on oeis.org

1, 1, 5, 1, 3, 2, 3, 2, 5, 1, 5, 2, 4, 4, 7, 2, 5, 5, 3, 3, 6, 1, 5, 3, 2, 6, 6, 2, 4, 2, 2, 2, 8, 2, 7, 3, 5, 6, 6, 1, 5, 6, 7, 7, 8, 4, 6, 5, 5, 7, 11, 3, 13, 5, 3, 6, 11, 4, 7, 6, 3, 7, 9, 5, 8, 6, 3, 8, 9, 5, 10, 3, 9, 8, 7, 2, 7, 6, 5, 4, 4, 3, 12, 7, 3, 9, 9, 5, 11, 8, 2, 5, 10, 3, 5, 5, 2, 9, 9, 4, 13
Offset: 0

Views

Author

Zhi-Wei Sun, Oct 09 2020

Keywords

Comments

Conjecture 1 (1-2-3 Conjecture): a(n) > 0 for all n >= 0. In other words, any positive odd integer m can be written as x^2 + y^2 + z^2 + w^2 with x, y, z, w nonnegative integers such that x + 2*y + 3*z = 2^k for some positive integer k.
Conjecture 2 (Strong Version of the 1-2-3 Conjecture): For any integer m > 4627 not congruent to 0 or 2 modulo 8, we can write m as x^2 + y^2 + z^2 + w^2 with x, y, z, w nonnegative integers such that x + 2*y + 3*z = 4^k for some positive integer k.
We have verified Conjectures 1 and 2 for m up to 5*10^6. Conjecture 2 implies that A299924(n) > 0 for all n > 0.
By Theorem 1.2(v) of the author's 2017 JNT paper, any positive integer n can be written as x^2 + y^2 + z^2 + 4^k with k, x, y, z nonnegative integers.
See also A338094 and A338095 for similar conjectures.

Examples

			a(1) = 1, and 2*1 + 1 = 1^2 + 0^2 + 1^2 + 1^2 with 1 + 2*0 + 3*1 = 2^2.
a(3) = 1, and 2*3 + 1 = 1^2 + 2^2 + 1^2 + 1^2 with 1 + 2*2 + 3*1 = 2^3.
a(9) = 1, and 2*9 + 1 = 1^2 + 6^2 + 1^2 + 1^2 with 1 + 2*6 + 3*1 = 2^4.
a(21) = 1, and 2*21 + 1 = 5^2 + 4^2 + 1^2 + 1^2 with 5 + 2*4 + 3*1 = 2^4.
a(39) = 1, and 2*39 + 1 = 1^2 + 5^2 + 7^2 + 2^2 with 1 + 2*5 + 3*7 = 2^5.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    PQ[n_]:=PQ[n]=n>1&&IntegerQ[Log[2,n]];
    tab={};Do[r=0;Do[If[SQ[2n+1-x^2-y^2-z^2]&&PQ[x+2y+3z],r=r+1],{x,0,Sqrt[2n+1]},{y,Boole[x==0],Sqrt[2n+1-x^2]},{z,0,Sqrt[2n+1-x^2-y^2]}]; tab=Append[tab,r],{n,0,100}];Print[tab]

A338095 Number of ways to write 2*n + 1 as x^2 + y^2 + z^2 + w^2 with x + y + 2*z a positive power of two, where x, y, z, w are nonnegative integers with x <= y.

Original entry on oeis.org

1, 2, 4, 1, 2, 3, 4, 2, 5, 3, 4, 2, 3, 3, 4, 1, 2, 3, 4, 2, 6, 3, 3, 3, 4, 5, 6, 4, 6, 6, 5, 3, 9, 5, 4, 2, 4, 5, 6, 2, 5, 4, 5, 3, 6, 4, 4, 5, 5, 3, 6, 5, 4, 3, 4, 2, 6, 5, 4, 2, 3, 3, 7, 5, 4, 6, 5, 4, 7, 1, 2, 3, 6, 4, 3, 3, 5, 5, 4, 2, 6, 2, 5, 3, 2, 8, 7, 5, 6, 6, 6, 4, 10, 8, 7, 4, 4, 9, 8, 6, 10
Offset: 0

Views

Author

Zhi-Wei Sun, Oct 09 2020

Keywords

Comments

Conjecture: a(n) > 0 for all n >= 0. Moreover, any integer m > 10840 not congruent to 0 or 2 modulo 8 can be written as x^2 + y^2 + z^2 + w^2 with x + y + 2*z = 4^k for some positive integer k, where x, y, z, w are nonnegative integers.
We have verified the latter assertion in the conjecture for m up to 5*10^6. By Theorem 1.4(i) of the author's 2019 IJNT paper, any positive integer m can be written as x^2 + y^2 + z^2 + w^2 with x, y, z, w integers such that x + y + 2*z = 4^k for some nonnegative integer k.
See also A338094 and A338096 for similar conjectures.

Examples

			a(3) = 1, and 2*3 + 1 = 1^2 + 1^2 + 1^2 + 2^2 with 1 + 1 + 2*1 = 2^2.
a(15) = 1, and 2*15 + 1 = 1^2 + 5^2 + 1^2 + 2^2 with 1 + 5 + 2*1 = 2^3.
a(69) = 1, and 2*69 + 1 = 7^2 + 9^2 + 0^2 + 3^2 with 7 + 9 + 2*0 = 2^4.
a(315) = 1, and 2*315 + 1 = 3^2 + 9^2 + 10^2 + 21^2 with 3 + 9 + 2*10 = 2^5.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    PQ[n_]:=PQ[n]=n>1&&IntegerQ[Log[2,n]];
    tab={};Do[r=0;Do[If[SQ[2n+1-x^2-y^2-z^2]&&PQ[x+y+2z],r=r+1],{x,0,Sqrt[(2n+1)/2]},{y,x,Sqrt[2n+1-x^2]},{z,Boole[x+y==0],Sqrt[2n+1-x^2-y^2]}];
    tab=Append[tab,r],{n,0,100}];Print[tab]

A300360 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that x or y is a power of 2 (including 1) and x + 63*y = 2^(2k+1) for some k = 0,1,2,....

Original entry on oeis.org

0, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 3, 1, 3, 4, 2, 2, 4, 1, 2, 1, 1, 2, 4, 3, 1, 1, 2, 1, 6, 2, 2, 2, 5, 1, 4, 1, 2, 6, 3, 3, 3, 1, 2, 3, 4, 3, 3, 2, 4, 2, 2, 1, 7, 3, 1, 4, 1, 2, 8, 1, 3, 7, 3, 4, 6, 3, 4, 4, 6, 4, 3, 2, 4, 3, 1, 2
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 03 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1, and a(n) = 1 only for n = 5, 13, 25, 29, 59, 61, 79, 91, 95, 101, 103, 1315, 2^k (k = 1,2,3,...), 2^(2k+1)*m (k = 0,1,2,... and m = 3, 5, 7, 11, 15, 19, 23).
Note the difference between the current sequence and A300356.
In the comments of A300219, the author conjectured that a positive square n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and x + 3*y are powers of 4 unless n has the form 4^k*81503 with k a nonnegative integer. Since 81503^2 = 208^2 + 16^2 + 51167^2 + 63440^2 with 16 = 4^2 and 208 + 3*16 = 4^4, this implies that any positive square can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x or y is a power of 4 and x + 3y is also a power of 4. We also conjecture that for any positive integer n not of the form 4^k*m (k =0,1,... and m = 2, 7) we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x or y is a power of 4 and x + 2*y is also a power of 4.

Examples

			a(38) = 1 since 38^2 = 2^2 + 0^2 + 12^2 + 36^2 with 2 = 2^1 and 2 + 63*0 = 2^1.
a(86) = 2 since 86 = 65^2 + 1^2 + 19^2 + 53^2 = 65^2 + 1^2 + 31^2 + 47^2 with 1 = 2^0 and 65 + 63*1 = 2^7.
a(535) = 3 since 535^2 = 2^2 + 130^2 + 64^2 + 515^2 = 2^2 + 130^2 + 139^2 + 500^2 = 8^2 + 520^2 + 40^2 + 119^2 with 2 = 2^1, 8 = 2^3, 2 + 63*130 = 2^13 and 8 + 63*520 = 2^15.
a(1315) = 1 since 1315^2 = 512^2 + 512^2 + 61^2 + 1096^2 with 512 = 2^9 and 512 + 63*512 = 2^15.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[a_,n_]:=Pow[a,n]=IntegerQ[Log[a,n]];
    tab={};Do[r=0;Do[If[SQ[n^2-x^2-y^2-z^2]&&(Pow[2,x]||Pow[2,y])&&Pow[4,(x+63y)/2],r=r+1],{x,0,n},{y,0,Sqrt[n^2-x^2]},{z,0,Sqrt[(n^2-x^2-y^2)/2]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A300356 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x >= y >= 0 <= z <= w such that x + 63*y = 2^(2k+1) for some nonnegative integer k.

Original entry on oeis.org

0, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 3, 1, 3, 4, 2, 2, 4, 1, 2, 1, 1, 2, 4, 3, 1, 1, 2, 1, 6, 2, 2, 2, 5, 1, 4, 1, 2, 6, 3, 3, 3, 1, 2, 3, 4, 3, 3, 2, 4, 2, 2, 1, 7, 3, 1, 4, 1, 2, 8, 1, 3, 7, 3, 4, 6, 3, 4, 4, 6, 5, 3, 2, 4, 3, 1, 2
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 03 2018

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1, and a(n) = 1 only for n = 5, 13, 25, 29, 59, 61, 91, 95, 101, 103, 211, 247, 2^k (k = 1,2,...), 4^k*79 (k = 0,1,2,...), 2^(2k+1)*m (k = 0,1,2,... and m = 3, 5, 7, 11, 15, 19, 23).
(ii) Let r be 0 or 1, and let n > r. Then n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 15*y = 2^(2k+r) for some k = 0,1,2,.... Also, we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 16*x - 15*y = 2^(2k+r) for some k = 0,1,2,....
We have verified that a(n) > 0 for all n = 2..10^7.
See also A299924 and A300219 for similar conjectures.

Examples

			a(5) = 1 sine 5^2 = 2^2 + 2^2 + 1^2 + 4^2 with 2 + 63*2 = 2^7.
a(6) = 1 since 6^2 = 2^2 + 0^2 + 4^2 + 4^2 with 2 + 63*0 = 2^1.
a(10) = 1 since 10^2 = 8^2 + 0^2 + 0^2 + 6^2 with 8 + 63*0 = 2^3.
a(13) = 1 since 13^2 = 8^2 + 8^2 + 4^2 + 5^2 with 8 + 63*8 = 2^9.
a(59) = 1 since 59^2 = 32^2 + 32^2 + 8^2 + 37^2 with 32 + 63*32 = 2^11.
a(85) = 2 since 85^2 = 32^2 + 0^2 + 24^2 + 75^2 = 32^2 + 0^2 + 51^2 + 60^2 with 32 + 63*0 = 2^5.
a(86) = 3 since 86^2 = 65^2 + 1^2 + 19^2 + 53^2 = 65^2 + 1^2 + 31^2 + 47^2 = 71^2 + 7^2 + 25^2 + 41^2 with 65 + 63*1 = 2^7 and 71 + 63*7 = 2^9.
a(247) = 1 since 247^2 = 2^2 + 2^2 + 76^2 + 235^2 with 2 + 63*2 = 2^7.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]]
    tab={};Do[r=0;Do[If[SQ[n^2-x^2-y^2-z^2]&&Pow[(x+63y)/2],r=r+1],{x,0,n},{y,0,Min[x,Sqrt[n^2-x^2]]},{z,0,Sqrt[(n^2-x^2-y^2)/2]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A337082 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with 2*x^2 + 4*y^2 - 7*x*y a power of two (including 2^0 = 1), where x, y, z, w are nonnegative integers with z <= w.

Original entry on oeis.org

2, 2, 2, 2, 5, 5, 1, 2, 5, 4, 3, 3, 4, 7, 3, 2, 8, 8, 4, 6, 10, 6, 3, 5, 5, 9, 4, 2, 8, 10, 2, 2, 9, 4, 5, 6, 5, 7, 3, 4, 10, 10, 1, 4, 9, 6, 2, 3, 6, 8, 6, 4, 11, 12, 4, 7, 10, 5, 3, 5, 5, 9, 5, 2, 14, 16, 3, 9, 18, 9, 3, 8, 9, 11, 7, 5, 12, 14, 3, 6, 16, 11, 5, 12, 12, 10, 4, 6, 15, 17, 6, 5, 12, 9, 4, 5, 7, 12, 7, 7
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 12 2020

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Moreover, any positive integer n congruent to 1 or 2 modulo 4 can be written as x^2 + y^2 + z^2 + w^2 with x, y, z, w nonnegative integers such that 2*x^2 + 4*y^2 - 7*x*y = 4^k for some positive integer k.
We have verified this for all n = 1..10^8.
See also A338139 for a similar conjecture.

Examples

			a(7) = 1, and 7 = 1^2 + 2^2 + 1^2 + 1^2 with 2*1^2 + 4*2^2 - 7*1*2 = 2^2.
a(43) = 1, and 43 = 4^2 + 1^2 + 1^2 + 5^2 with 2*4^2 + 4*1^2 - 7*4*1 = 2^3.
a(283) = 1, and 283 = 4^2 + 7^2 + 7^2 + 13^2 with 2*4^2 + 4*7^2 - 7*4*7 = 2^5.
a(2731) = 1, and 2731 = 5^2 + 7^2 + 16^2 + 49^2 with 2*5^2 + 4*7^2 - 7*5*7 = 2^0.
a(25475) = 1, and 25475 = 68^2 + 95^2 + 45^2 + 99^2 with 2*68^2 + 4*95^2 - 7*68*95 = 2^7.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    PQ[n_]:=PQ[n]=n>0&&IntegerQ[Log[2,n]];
    tab={};Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&PQ[2x^2+4*y^2-7*x*y],r=r+1],{x,0,Sqrt[n]},{y,Boole[x==0],Sqrt[n-x^2]},{z,0,Sqrt[(n-x^2-y^2)/2]}];tab=Append[tab,r],{n,1,100}];tab
Showing 1-10 of 16 results. Next