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.

A301534 Number of ways to write the n-th prime congruent to 7 modulo 12 as x^2 + 3*y^2 + 15*2^z with x,y,z nonnegative integers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1. In other words, any prime p > 7 with p == 7 (mod 12) can be written as x^2 + 3*y^2 + 15*2^z with x,y,z nonnegative integers.
We have verified the conjecture for all primes p == 7 (mod 12) with 7 < p < 8*10^9.

Examples

			a(1) = 0 since 7 cannot be written as x^2 + 3*y^2 + 15*2^z with x,y,z nonnegative integers.
a(2) = 2 since the second prime congruent to 7 modulo 12 is 19 and 19 = 1^2 + 3*1^2 + 15*2^0 = 2^2 + 3*0^2 + 15*2^0.
		

Crossrefs

Programs

  • Mathematica
    p[n_]:=p[n]=Prime[n];
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{2},Mod[Part[Part[f[n],i],1],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]);
    n=0;Do[If[Mod[p[m],12]!=7,Goto[aa]];n=n+1;r=0;Do[If[QQ[p[m]-15*2^k],Do[If[SQ[p[m]-15*2^k-3x^2],r=r+1],{x,0,Sqrt[(p[m]-15*2^k)/3]}]],{k,0,Log[2,p[m]/15]}];Print[n," ",r];Label[aa],{m,1,315}]

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]

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.