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 21-24 of 24 results.

A302641 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.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 10 2018

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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]

A301805 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.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 27 2018

Keywords

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)

Examples

			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.
		

Crossrefs

Programs

  • 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]

A301858 Positive integers which can be written as the sum of two squares but cannot be written as x^2 + y^2 + 2*z^2 with x and y integers and z a nonzero integer.

Original entry on oeis.org

1, 5, 29, 65
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 27 2018

Keywords

Comments

The sequence has no term in the interval [66, 10^6].
Conjecture 1: The sequence only has the four terms 1, 5, 29 and 65.
Conjecture 2: For any integer n > 1 which is neither 17 nor a power of 2, if n = u^2 + 2*v^2 for some integers u and v, then n = x^2 + 2*y^2 + 3*z^2 for some integers x,y,z with z nonzero.
Conjecture 3: For any positive integer n not of the form 4^k*m (k = 0,1,2,... and m = 1, 7, 13), if n = u^2 + 3*v^2 for some integers u and v, then n = x^2 + 2*y^2 + 3*z^2 for some integers x,y,z with y nonzero.

Crossrefs

Programs

  • 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]);
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[If[QQ[m]==False,Goto[aa]];Do[If[SQ[m-2x^2-y^2],Goto[aa]],{x,1,Sqrt[m/2]},{y,0,Sqrt[(m-2x^2)/2]}];tab=Append[tab,m];Label[aa],{m,1,1000}];Print[tab]

A301891 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.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 28 2018

Keywords

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.

Examples

			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.
		

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[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]
Previous Showing 21-24 of 24 results.