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.

Previous Showing 11-16 of 16 results.

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

A279616 Numbers of the form x^2 + y^2 + z^2 with x + 2*y - 2*z a power of four (including 4^0 = 1), where x,y,z are nonnegative integers.

Original entry on oeis.org

1, 3, 4, 5, 9, 10, 14, 16, 17, 18, 19, 20, 22, 24, 29, 33, 34, 35, 37, 41, 45, 48, 49, 50, 51, 52, 53, 58, 59, 61, 64, 65, 66, 68, 69, 70, 73, 74, 77, 78, 80, 82, 84, 88, 89, 90, 94, 97, 98, 99, 100, 104, 106, 107, 109, 113, 114, 116, 117, 121, 122, 125, 129, 130, 132, 133, 138, 139, 141, 144
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 15 2016

Keywords

Comments

Part (i) of the conjecture in A279612 implies that any positive integer can be written as the sum of a square and a term of the current sequence.
It seems that a(n)/n has the limit 2 as n tends to the infinity.

Examples

			a(1) = 1 since 1 = 1^2 + 0^2 + 0^2 + 0^2 with 1 + 2*0 - 2*0 = 4^0.
a(2) = 3 since 3 = 1^2 + 1^2 + 1^2 + 0^2 with 1 + 2*1 - 2*1 = 4^0.
a(4) = 5 since 5 = 2^2 + 1^2 + 0^2 + 0^2 with 2 + 2*1 - 2*0 = 4.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    FP[n_]:=FP[n]=n>0&&IntegerQ[Log[4,n]];
    ex={};Do[Do[If[SQ[m-x^2-y^2]&&FP[x+2y-2*Sqrt[m-x^2-y^2]],ex=Append[ex,m];Goto[aa]],{x,0,Sqrt[m]},{y,0,Sqrt[m-x^2]}];Label[aa];Continue,{m,1,144}]

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 02 2017

Keywords

Comments

65213 is the first positive integer which cannot be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w integers such that both x and x + y + z are powers of two. Though a(44997) = 0, we have
44997 = 128^2 + (-28)^2 + (-98)^2 + 1^2 with 128 = 2^7 and 128 + (-28) + (-98) = 2^1.

Examples

			a(1) = 1 since 1 = 1^2 + 0^2 + 0^2 + 0^2 with 1 = 2^0 and 1 + 0 - 0 = 2^0.
a(2237) = 1 since 2237 = 8^2 + 29^2 + 36^2 + 6^2 with 8 = 2^3 and 8 + 29 - 36 = 2^0.
a(4397) = 1 since 4397 = 4^2 + 21^2 + 24^2 + 58^2 with 4 = 2^2 and 4 + 21 - 24 = 2^0.
a(5853) = 1 since 5853 = 2^2 + 52^2 + 52^2 + 21^2 with 2 = 2^1 and 2 + 52 - 52 = 2^1.
a(14711) = 1 since 14711 = 1^2 + 18^2 + 15^2 + 119^2 with 1 = 2^0 and 1 + 18 - 15 = 2^2.
a(16797) = 1 since 16797 = 64^2 + 42^2 + 104^2 + 11^2 with 64 = 2^6 and 64 + 42 - 104 = 2^1.
a(17861) = 1 since 17861 = 32^2 + 0^2 + 31^2 + 126^2 with 32 = 2^5 and 32 + 0 - 31 = 2^0.
a(20959) = 1 since 20959 = 2^2 + 109^2 + 95^2 + 7^2 with 2 = 2^1 and 2 + 109 - 95 = 2^4.
a(21799) = 1 since 21799 = 1^2 + 146^2 + 19^2 + 11^2 with 1 = 2^0 and 1 + 146 - 19 = 2^7.
a(24757) = 1 since 24757 = 64^2 + 56^2 + 119^2 + 58^2 with 64 = 2^6 and 64 + 56 - 119 = 2^0.
a(28253) = 1 since 28253 = 2^2 + 3^2 + 4^2 + 168^2 with 2 = 2^1 and 2 + 3 - 4 = 2^0.
		

Crossrefs

Programs

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

A299825 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x <= y, x == y (mod 2), and |x+y-z| is a power of 4 (including 4^0 = 1).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 19 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 1, 2, 6, 13, 15, 18, 27, 43, 53, 63, 93, 107, 109, 123, 141, 159, 165, 173, 477, 493, 653, 1005, 16^k*m (k = 0,1,2,... and m = 3, 4, 7, 8).
We have verified that a(n) > 0 for all n = 1..5*10^6.
A weaker version of the conjecture was proved by the author in arXiv:1701.05868.

Examples

			a(8) = 1 since 8 = 2^2 + 2^2 + 0^2 + 0^2 with 2 == 2 (mod 2) and 2 + 2 - 0 = 4.
a(13) = 1 since 13 = 0^2 + 2^2 + 3^2 + 0^2 with 0 == 2 (mod 2) and 0 + 2 - 3 = -4^0.
a(109) = 1 since 109 = 2^2 + 4^2 + 5^2 + 8^2 with 2 == 4 (mod 2) and 2 + 4 - 5 = 4^0.
a(123) = 1 since 123 = 1^2 + 3^2 + 8^2 + 7^2 with 1 == 3 (mod 2) and 1 + 3 - 8 = -4.
a(477) = 1 since 477 = 0^2 + 10^2 + 11^2 + 16^2 with 0 == 10 (mod 2) and 0 + 10 - 11 = -4^0.
a(653) = 1 since 653 = 8^2 + 12^2 + 21^2 + 2^2 with 8 == 12 (mod 2) and 8 + 12 - 21 = -4^0.
a(1005) = 1 since 1005 = 0^2 + 10^2 + 11^2 + 28^2 with 0 == 10 (mod 2) and 0 + 10 - 11 = -4^0.
		

Crossrefs

Programs

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

A284343 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and y <= z such that 2*x + y - z is either zero or a power of 8 (including 8^0 = 1).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 25 2017

Keywords

Comments

Conjecture: (i) For any c = 1,2,4, each n = 0,1,2,... can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and y <= z such that c*(2*x+y-z) is either zero or a power of eight (including 8^0 = 1).
(ii) Each n = 0,1,2,... can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that P(x,y,z,w) is either zero or a power of four (including 4^0 = 1), whenever P(x,y,z,w) is among the polynomials 2*x-y, x+y-z, x-y-z, x+y-2*z, 2*x+y-z, 2*x-y-z, 2*x-2*y-z, x+2*y-3*z, 2*x+2*y-2*z, 2*x+2*y-4*z, 3*x-2*y-z, x+3*y-3*z, 2*x+3*y-3*z, 4*x+2*y-2*z, 8*x+2*y-2*z, 2*(x-y)+z-w, 4*(x-y)+2*(z-w).
Part (i) of the conjecture is stronger than the first part of Conjecture 4.4 in the linked JNT paper (see also A273432).
Modifying the proofs of Theorem 1.1 and Theorem 1.2(i) in the linked JNT paper slightly, we see that for any a = 1,4 and m = 4,5,6 we can write each n = 0,1,2,... as a*x^m + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x is either zero or a power of two (including 2^0 = 1), and that for any b = 1,2 each n = 0,1,2,... can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that b*(x-y) is either zero or a power of 4 (including 4^0 = 1).
Starts to differ from A273432 at n=197. - R. J. Mathar, May 25 2023

Examples

			a(4) = 1 since 4 = 0^2 + 0^2 + 0^2 + 2^2 with 0 = 0 and 2*0 + 0 - 0 = 0.
a(5) = 1 since 5 = 1^2 + 0^2 + 2^2 + 0^2 with 0 < 2 and 2*1 + 0 - 2 = 0.
a(7) = 1 since 7 = 1^2 + 1^2 + 2^2 + 1^2 with 1 < 2 and 2*1 + 1 - 2 = 8^0.
a(40) = 1 since 40 = 4^2 + 2^2 + 2^2 + 4^2 with 2 = 2 and 2*4 + 2 - 2 = 8.
a(138) = 1 since 138 = 3^2 + 5^2 + 10^2 + 2^2 with 5 < 10 and 2*3 + 5 - 10 = 8^0.
a(1832) = 1 since 1832 = 4^2 + 30^2 + 30^2 + 4^2 with 30 = 30 and 2*4 + 30 - 30 = 8.
a(2976) = 1 since 2976 = 20^2 + 16^2 + 48^2 + 4^2 with 16 < 48 and 2*20 + 16 - 48 = 8.
		

Crossrefs

Programs

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

A350021 Number of ways to write n as w^4 + x^2 + y^2 + z^2 with x - y a power of two (including 2^0 = 1).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 08 2021

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0.
This is a new refinement of Lagrange's four-square theorem, and we have verified it for n up to 10^6.
If x - y = 2^k, then x^2 + y^2 = ((x+y)^2 + (2^k)^2)/2 and x + y >= 2^k. So the above conjecture implies the conjecture in A349661.
In his 2017 JNT paper, the author proved that each n = 0,1,2,... can be written as w^4 + x^2 + y^2 + z^2 with w,x,y,z nonnegative integers.
In his 2019 IJNT paper, the author proved that any positive integer can be written as w^2 + x^2 + y^2 + z^2 with w,x,y,z nonnegative integers such that x - y is a power of two (including 2^0 = 1).

Examples

			a(3) = 1 with 3 = 1^4 + 1^2 + 0^2 + 1^2 and 1 - 0 = 2^0.
a(4) = 1 with 4 = 0^4 + 2^2 + 0^2 + 0^2 and  2 - 0 = 2^1.
a(7) = 1 with 7 = 1^4 + 2^2 + 1^2 + 1^2 and 2 - 1 = 2^0.
a(8) = 1 with 8 = 0^4 + 2^2 + 0^2 + 2^2 and 2 - 0 = 2^1.
a(12) = 1 with 12 = 1^4 + 3^2 + 1^2 + 1^2 and 3 - 1 = 2^1.
a(19) = 1 with 19 = 0^4 + 3^2 + 1^2 + 3^2 and 3 - 1 = 2^1.
a(28) = 1 with 28 = 1^4 + 5^2 + 1^2 + 1^2 and 5 - 1 = 2^2.
a(47) = 1 with 47 = 1^4 + 3^2 + 1^2 + 6^2 and 3 - 1 = 2^1.
a(55) = 1 with 55 = 1^4 + 2^2 + 1^2 + 7^2 and 2 - 1 = 2^0.
a(88) = 1 with 88 = 0^4 + 6^2 + 4^2 + 6^2 and 6 - 4 = 2^1.
a(103) = 1 with 103 = 3^4 + 3^2 + 2^2 + 3^2 and 3 - 2 = 2^0.
a(193) = 1 with 193 = 2^4 + 8^2 + 7^2 + 8^2 and 8 - 7 = 2^0.
a(439) = 1 with 439 = 3^4 + 5^2 + 3^2 + 18^2 and 5 - 3 = 2^1.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    PowQ[n_]:=PowQ[n]=IntegerQ[Log[2,n]];
    tab={};Do[r=0;Do[If[SQ[n-w^4-x^2-y^2]&&PowQ[y-x],r=r+1],{w,0,(n-1)^(1/4)},{x,0,Sqrt[(n-w^4)/2]},{y,x+1,Sqrt[n-w^4-x^2]}];tab=Append[tab,r],{n,1,100}];Print[tab]
Previous Showing 11-16 of 16 results.