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-8 of 8 results.

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]

A338119 Positive integers not congruent to 0 or 2 modulo 8 which cannot be written as x^2 + y^2 + z^2 + w^2 with x + y + 2*z a positive power of 4, where x, y, z, w are nonnegative integers.

Original entry on oeis.org

1, 15, 22, 23, 27, 31, 36, 37, 38, 183, 193, 223, 237, 254, 279, 283, 285, 310, 311, 325, 331, 343, 349, 358, 359, 379, 381, 389, 399, 421, 429, 430, 436, 447, 463, 465, 471, 475, 479, 483, 503, 511, 513, 516, 523, 541, 547, 553, 555, 556, 557, 559, 563, 565, 566, 598, 599, 603, 604, 611, 625, 631, 639, 645, 647, 649, 651
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 10 2020

Keywords

Comments

Conjecture: The sequence has exactly 124 terms as listed in the b-file with 10839 the last one.
See also the related sequence A338095.

Examples

			a(1) = 1, for, if x, y, z, w are nonnegative integers with x^2 + y^2 + z^2 + w^2 = 1 then x + y + 2*z < 4.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    FQ[n_]:=FQ[n]=n>1&&IntegerQ[Log[4,n]];
    tab={};Do[If[Mod[m,8]==0||Mod[m,8]==2,Goto[aa]];Do[If[SQ[m-x^2-y^2-z^2]&&FQ[x+y+2z],Goto[aa]],{x,0,Sqrt[m/2]},{y,x,Sqrt[m-x^2]},{z,0,Sqrt[m-x^2-y^2]}];tab=Append[tab,m];Label[aa],{m,1,660}];tab

A338121 Positive integers not congruent to 0 mod 6 which cannot be written as x^2 + y^2 + z^2 + w^2 with x + y = 4^k for some positive integer k, where x, y, z, w are nonnegative integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 31, 43, 67, 79, 85, 87, 103, 115, 475, 643, 1015, 1399, 1495, 1723, 1819, 1939, 1987
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 11 2020

Keywords

Comments

Conjecture: The sequence only has 23 terms as listed.
See also the related sequence A338094.

Examples

			a(n) = n for n = 1..5, this is because x + y < 4 if x, y, z, w are nonnegative integers satisfying x^2 + y^2 + z^2 + w^2 <= 5.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    FQ[n_]:=FQ[n]=n>1&&IntegerQ[Log[4,n]];
    tab={};Do[If[Mod[m,8]==0||Mod[m,8]==6,Goto[aa]];Do[If[SQ[m-x^2-y^2-z^2]&&FQ[x+y],Goto[aa]],{x,0,Sqrt[m/2]},{y,x,Sqrt[m-x^2]},{z,0,Sqrt[(m-x^2-y^2)/2]}];tab=Append[tab,m];Label[aa],{m,1,2000}];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

A338139 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x^2 + 26*y^2 - 11*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

1, 2, 2, 2, 3, 4, 2, 2, 4, 5, 3, 4, 3, 4, 3, 2, 4, 6, 3, 5, 6, 4, 2, 4, 4, 5, 4, 4, 4, 6, 2, 2, 7, 5, 3, 6, 5, 4, 3, 5, 7, 8, 1, 4, 8, 4, 2, 4, 5, 6, 4, 5, 5, 6, 4, 4, 8, 5, 2, 6, 4, 3, 3, 2, 8, 11, 3, 5, 11, 6, 1, 6, 8, 7, 5, 4, 6, 5, 1, 5, 10, 10, 5, 9, 8, 5, 4, 4, 8, 14, 5, 5, 8, 4, 4, 4, 6, 7, 5, 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 x^2 + 26*y^2 - 11*x*y = 4^k for some nonnegative integer k.
We have verified this for all n = 1..10^8.
See also A337082 for a similar conjecture.

Examples

			a(1) = 1, and 1 = 1^2 + 0^2 + 0^2 + 0^2 with 1^2 + 26*0^2 - 11*1*0 = 2^0.
a(43) = 1, and 43 = 1^2 + 1^2 + 4^2 + 5^2 with 1^2 + 26*1^2 - 11*1*1 = 2^4.
a(6547) = 1, and 6547 = 17^2 + 1^2 + 4^2 + 79^2 with 17^2 + 26*1^2 - 11*17*1 = 2^7.
a(11843) = 1, and 11843 = 3^2 + 1^2 + 13^2 + 108^2 with 3^2 + 26*1^2 - 11*3*1 = 2^1.
		

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[x^2+26*y^2-11*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

A338162 Number of ways to write 4*n + 1 as x^2 + y^2 + z^2 + w^2 with x^2 + 7*y^2 = 2^k for some k = 0,1,2,..., where x, y, z, w are nonnegative integers with z <= w.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 14 2020

Keywords

Comments

Conjecture: a(n) > 0 for all n >= 0. Moreover, if m > 1 has the form 2^a*(2*b+1), and either a is positive and even, or b is even, then m can be written as x^2 + y^2 + z^2 + w^2 with x^2 + 7*y^2 = 2^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 4*10^8.

Examples

			a(0) = 1, and 4*0 + 1 = 1^2 + 0^2 + 0^2 +0^2 with 1^2 + 7*0^2 = 2^0.
a(25) = 2, and 25 = 2^2 + 2^2 + 1^2 + 4^2 = 4^2 + 0^2 + 0^2 + 3^2
with 2^2 + 7*2^2 = 2^5 and 4^2 + 7*0^2 = 2^4.
		

Crossrefs

Programs

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

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Oct 30 2020

Keywords

Comments

Conjecture 1: a(n) > 0 if n is neither of the form 4^k*(4*m+3) (k>=0, m>=0) nor of the form 2^(4*k+3)*101 (k>=0). In particular, a(n^2) > 0 and a(2*n^2) > 0 for all n > 0.
Conjecture 2: Any positive integer not of the form 16^k*m (k>=0, m = 1, 25, 46, 88) can be written as x^2 + y^2 + z^2 + w^2 (x,y,z,w >= 0) such that 2*x - y = 4^a for some nonnegative integer a.
Conjecture 3: Any positive integer of the form 2^k*(2*m+1) (k>=0, m>=0) with k == floor(m/2) (mod 2) (such as positive squares) can be written as x^2 + y^2 + z^2 + w^2 (x,y,z,w >= 0) such that x + 3*y = 4^a for some nonnegative integer a.

Examples

			a(7) = 1, and 7 = 2^2 + 1^2 + 1^2 + 1^2 with 2 + 2*1 = 4.
a(35) = 1, and 35 = 1^2 + 0^2 + 3^2 + 5^2 with 1 + 2*0 = 4^0.
a(49) = 1, and 49 = 0^2 + 2^2 + 3^2 + 6^2 with 0 + 2*2 = 4.
		

Crossrefs

Programs

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