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

A302920 Number of ways to write prime(n)^2 as x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 15 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. In other words, for any prime p there are nonnegative integers x, y and z such that x^2 + 2*y^2 + 3*2^z = p^2.
As mentioned in A301471, for the composite number m = 5884015571 = 7*17*49445509 there are no nonnegative integers x,y,z such that x^2 + 2*y^2 + 3*2^z = m^2.

Examples

			a(1) = 1 with prime(1)^2 = 4 = 1^2 + 2*0^2 + 3*2^0.
a(2) = 2 with prime(2)^2 = 9 = 2^2 + 2*1^2 + 3*2^0 = 1^2 + 2*1^2 + 3*2^1.
		

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[(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[p[n]^2-3*2^k],Do[If[SQ[p[n]^2-3*2^k-2x^2],r=r+1],{x,0,Sqrt[(p[n]^2-3*2^k)/2]}]],{k,0,Log[2,p[n]^2/3]}];tab=Append[tab,r],{n,1,70}];Print[tab]

A302981 Number of ways to write n as x^2 + 2*y^2 + 2^z + 2^w, where x,y,z,w are nonnegative integers with z <= w.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

Clearly, a(2*n) > 0 if a(n) > 0. We note that 52603423 is the first value of n > 1 with a(n) = 0.
See also A302982 and A302983 for related things.

Examples

			a(2) = 1 with 2 = 0^2 + 2*0^2 + 2^0 + 2^0.
a(3) = 2 with 3 = 1^2 + 2*0^2 + 2^0 + 2^0 = 0^2 + 2*0^2 + 2^0 + 2^1.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{5,7},Mod[Part[Part[f[n],i],1],8]]&&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^k-2^j],Do[If[SQ[n-2^k-2^j-2x^2],r=r+1],{x,0,Sqrt[(n-2^k-2^j)/2]}]],{k,0,Log[2,n]-1},{j,k,Log[2,Max[1,n-2^k]]}];tab=Append[tab,r],{n,1,60}];Print[tab]

A302983 Number of ways to write n as x^2 + 2*y^2 + 2^z + 3*2^w with x,y,z,w nonnegative integers.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 4, 5, 4, 5, 6, 4, 8, 8, 7, 12, 8, 6, 9, 9, 6, 13, 13, 8, 13, 12, 8, 13, 14, 11, 15, 17, 8, 14, 11, 11, 16, 17, 11, 17, 19, 8, 17, 19, 10, 19, 18, 12, 15, 17, 12, 20, 17, 13, 20, 18, 16, 24, 18, 15
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
Clearly, a(2*n) > 0 if a(n) > 0. We have verified a(n) > 0 for all n = 4..6*10^9.
See also A302982 and A302984 for similar conjectures.

Examples

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

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{5,7},Mod[Part[Part[f[n],i],1],8]]&&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-3*2^k-2^j],Do[If[SQ[n-3*2^k-2^j-2x^2],r=r+1],{x,0,Sqrt[(n-3*2^k-2^j)/2]}]],{k,0,Log[2,n/3]},{j,0,Log[2,Max[1,n-3*2^k]]}];tab=Append[tab,r],{n,1,60}];Print[tab]

A302985 Number of ordered pairs (x, y) of nonnegative integers such that n - 2^x - 3*2^y has the form u^2 + 2*v^2 with u and v integers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This is equivalent to the author's conjecture in A302983. We have verified a(n) > 0 for all n = 4...6*10^9.
See also A302982 and A302984 for similar conjectures.

Examples

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

Crossrefs

Programs

  • Mathematica
      f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[MemberQ[{5,7},Mod[Part[Part[f[n],i],1],8]]&&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-3*2^k-2^j],r=r+1],{k,0,Log[2,n/3]},{j,0,If[3*2^k==n,-1,Log[2,n-3*2^k]]}];tab=Append[tab,r],{n,1,60}];Print[tab]

A301479 Positive integers m such that m^3 cannot be written in the form x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.

Original entry on oeis.org

1, 53, 69, 71, 77, 87, 101, 103, 106, 117, 127, 133, 138, 142, 149, 159, 173, 174, 181, 191, 197, 199, 202, 206, 207, 212, 213, 221, 223, 229, 231, 234, 266, 269, 276, 277, 284, 293, 298, 309, 311, 325, 341, 346, 348, 351, 357, 362, 365, 373, 389, 398, 404, 412, 423, 424, 426, 429
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 22 2018

Keywords

Comments

It seems that this sequence has infinitely many terms. In contrast, the author conjectured in A301471 and A301472 that any square greater than one can be written as x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).

Examples

			a(1) = 1 since x^2 + 2*y^2 + 3*2^z > 1^3 for all x,y,z = 0,1,2,....
		

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]);
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[Do[If[QQ[m^3-3*2^k],Goto[aa]],{k,0,Log[2,m^3/3]}];tab=Append[tab,m];Label[aa],{m,1,429}];Print[tab]

A301579 Least nonnegative integer k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers, or -1 if no such k exists.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 23 2018

Keywords

Comments

The Square Conjecture in A301471 implies that a(n) >= 0 for all n > 1.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).
Numbers t such that a(t) = 0 are 2, 3, 5, 6, 10, 11, 13, 14, 18, 19, 21, 26, 27, 29, 34, 37, ... - Altug Alkan, Mar 26 2018

Examples

			a(1) = -1 since 1^2 - 3*2^k < 0 for all k = 0,1,2,....
a(31) = 3 since 31^2 - 3*2^3 = 17^2 + 2*18^2.
a(2^k) = 2*k - 2 for all k = 1,2,3,..., because (2^k)^2 - 3*2^(2*k-2) = (2^(k-1))^2 + 2*0^2, and (2^k)^2 - 3*2^j = 2^j*(2^(2*k-j) - 3) with 0 <= j < 2*k-2 cannot be written as x^2 + 2*y^2 with x and y integers.
		

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[Do[If[QQ[n^2-3*2^k],tab=Append[tab,k];Goto[aa]],{k,0,Log[2,n^2/3]}];tab=Append[tab,-1];Label[aa],{n,1,80}];Print[tab]

A301640 Largest integer k such that n^2 - 3*2^k can be written as x^2 + 2*y^2 with x and y integers, or -1 if no such k exists.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 25 2018

Keywords

Comments

Conjecture: a(n) > 0.6*log_2(log_2 n) for all n > 2, and also lim inf_{n->infinity} a(n)/(log n) = 0.
The author's Square Conjecture in A301471 would imply that a(n) >= 0 for all n > 1. We have verified that a(n) > 0.6*log_2(log_2 n) for all n = 3..4*10^9. For n = 2857932461, we have a(n) = 3 and 0.603 < a(n)/log_2(log_2 n) < 0.604.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).

Examples

			a(2) = 0 since 2^2 - 3*2^0 = 1^2 + 2*0^2.
a(3) = 1 since 3^2 - 3*2^1 = 2^2 + 2*1^2.
a(5) = 3 since 5^2 - 3*2^3 = 1^2 + 2*0^2.
a(6434567) = 10 since 6434567^2 - 3*2^10 = 5921293^2 + 2*1780722^2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,t;
        for k from floor(log[2](n^2/3)) by -1 to 0 do
           if g(n^2 - 3*2^k) then return k fi
        od;
        -1
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 26 2018
  • 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[Do[If[QQ[n^2-3*2^(Floor[Log[2,n^2/3]]-k)],tab=Append[tab,Floor[Log[2,n^2/3]]-k];Goto[aa]],{k,0,Log[2,n^2/3]}];tab=Append[tab,-1];Label[aa],{n,1,70}];Print[tab]

A303235 Number of ordered pairs (x, y) with 0 <= x <= y such that n - 2^x - 2^y can be written as the sum of two triangular numbers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 20 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
Note that a nonnegative integer m is the sum of two triangular numbers if and only if 4*m+1 (or 8*m+2) can be written as the sum of two squares.
We have verified a(n) > 0 for all n = 2..4*10^8. See also the related sequences A303233 and A303234.

Examples

			a(2) = 1 with 2 - 2^0 - 2^0 = 0*(0+1)/2 + 0*(0+1)/2.
a(3) = 2 with 3 - 2^0 - 2^0 = 0*(0+1)/2 + 1*(1+1)/2 and 3 - 2^0 - 2^1 = 0*(0+1)/2 + 0*(0+1)/2.
		

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]);
    tab={};Do[r=0;Do[If[QQ[4(n-2^k-2^j)+1],r=r+1],{k,0,Log[2,n]-1},{j,k,Log[2,n-2^k]}];tab=Append[tab,r],{n,1,60}];Print[tab]

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]
Previous Showing 11-20 of 21 results. Next