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 48 results. Next

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 21 2018

Keywords

Comments

Square Conjecture: a(n) > 0 for all n > 1. Moreover, for any integer n > 3 we can write n^2 as x^2 + 2*y^2 + 3*2^z, where x,y,z are nonnegative integers with y even and z > 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).
See also A301472 for the list of positive integers not of the form x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.
If n^2 = x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers, then it is easy to see that x is not divisible by 3.
The Square Conjecture implies that for each n = 1,2,3,... we can write 3*n^2 as x^2 + 2*y^2 + 2^z with x,y,z nonnegative integers. In fact, if (3*n)^2 = u^2 + 2*v^2 + 3*2^z with u,v,z integers and z >= 0, then u^2 == v^2 (mod 3) and thus we may assume u == v (mod 3) without loss of generality, hence 3*n^2 = (u^2+2*v^2)/3 + 2^z = x^2 + 2*y^2 + 2^z with x = (u+2*v)/3 and y = (u-v)/3 integers.
On March 25, 2018 Qing-Hu Hou at Tianjin Univ. finished his verification of the Square Conjecture for n <= 4*10^8. Then I used Hou's program to verify the conjecture for n <= 5*10^9. - Zhi-Wei Sun, Apr 10 2018
I have found a counterexample to the Square Conjecture, namely a(5884015571) = 0. Note that 5884015571 is the product of the three primes 7, 17 and 49445509. - Zhi-Wei Sun, Apr 15 2018

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(4) = 1 with 4^2 = 2^2 + 2*0^2 + 3*2^2.
a(1131599953) = 1 with 1131599953^2 = 316124933^2 + 2*768304458^2 + 3*2^6.
a(5884015571) = 0 since there are no nonnegative integers x,y,z such that  x^2 + 2*y^2 + 3*2^z = 5884015571^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[r=0;Do[If[QQ[n^2-3*2^k],Do[If[SQ[n^2-3*2^k-2x^2],r=r+1],{x,0,Sqrt[(n^2-3*2^k)/2]}]],{k,0,Log[2,n^2/3]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A301472 Positive integers not of the form x^2 + 2*y^2 + 3*2^z with x,y,z nonnegative integers.

Original entry on oeis.org

1, 2, 77, 154, 157, 173, 285, 308, 311, 314, 317, 346, 383, 397, 477, 493, 509, 557, 570, 616, 621, 634, 692, 701, 717, 727, 733, 757, 766, 794, 797, 877, 909, 954, 957, 986, 997, 1013, 1018, 1069, 1085, 1093, 1111, 1114, 1117, 1181, 1197, 1221, 1232, 1242, 1268, 1277, 1293
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 21 2018

Keywords

Comments

It might seem that 1 is the only square in this sequence, but 5884015571^2 is also a term of this sequence.
See also A301471 for related information.
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 and a(2) = 2 since x^2 + 2*y^2 + 3*2^z > 2 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*2^k],Goto[aa]],{k,0,Log[2,m/3]}];tab=Append[tab,m];Label[aa],{m,1,1293}];Print[tab]

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]

A097700 Numbers not of form x^2 + 2y^2.

Original entry on oeis.org

5, 7, 10, 13, 14, 15, 20, 21, 23, 26, 28, 29, 30, 31, 35, 37, 39, 40, 42, 45, 46, 47, 52, 53, 55, 56, 58, 60, 61, 62, 63, 65, 69, 70, 71, 74, 77, 78, 79, 80, 84, 85, 87, 90, 91, 92, 93, 94, 95, 101, 103, 104, 105, 106, 109, 110, 111, 112, 115, 116, 117, 119, 120, 122
Offset: 1

Views

Author

Ralf Stephan, Aug 23 2004

Keywords

Comments

Is lim_{n->inf} a(n)/n = 3/4?

Crossrefs

Complement of A002479.

Programs

  • Magma
    [n: n in [0..160] | NormEquation(2, n) eq false]; // Vincenzo Librandi, Jan 15 2017
  • Mathematica
    formQ[n_]:=Reduce[x>=0&&y>=0&&n==x^2 + 2 y^2, {x, y}, Integers]==False; Select[Range[0, 200], formQ] (* Vincenzo Librandi, Jan 15 2017 *)

A301452 Number of ways to write n^2 as m*4^k + x^2 + 2*y^2 with m in the set {2, 3} and k,x,y nonnegative integers.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 21 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
We call this the 2-3 conjecture. It is simialr to the author's 2-5 conjecture which states that A300510(n) > 0 for all n > 1.
We have verified that a(n) > 0 for all n = 2..5*10^7.
It is known that the number of ways to write a positive integer n as x^2 + 2*y^2 with x and y integers is twice the difference |{d > 0: d|n and d == 1,3 (mod 8)}| - |{d>0: d|n and d == 5,7 (mod 8)}|.

Examples

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

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=n/2^(IntegerExponent[n,2]);
    OD[n_]:=OD[n]=Divisors[f[n]];
    QQ[n_]:=QQ[n]=(n==0)||(n>0&&Sum[JacobiSymbol[-2,Part[OD[n],i]],{i,1,Length[OD[n]]}]!=0);
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[r=0;Do[If[QQ[n^2-m*4^k],Do[If[SQ[n^2-m*4^k-2x^2],r=r+1],{x,0,Sqrt[(n^2-m*4^k)/2]}]],{m,2,3},{k,0,Log[4,n^2/m]}];tab=Append[tab,r],{n,1,80}];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]

A216451 Numbers which are simultaneously of the form x^2+y^2, x^2+2y^2, x^2+3y^2, x^2+7y^2, all with x>0, y>0.

Original entry on oeis.org

193, 337, 457, 673, 772, 1009, 1033, 1129, 1201, 1297, 1348, 1737, 1801, 1828, 1873, 2017, 2137, 2377, 2473, 2521, 2689, 2692, 2713, 2857, 3033, 3049, 3088, 3217, 3313, 3361, 3529, 3600, 3697, 3889, 4036, 4057, 4113, 4132, 4153, 4201, 4516, 4561, 4624, 4657
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Comments

A number can be written as a^2+b^2 if and only if it has no prime factor congruent to 3 (mod 4) raised to an odd power.
A number can be written as a^2+2*b^2 if and only if it has no prime factor congruent to 5 (mod 8) or 7 (mod 8) raised to an odd power.
A number can be written as a^2+3*b^2 if and only if it has no prime factor congruent to 2 (mod 3) raised to an odd power.
A number can be written as a^2+7*b^2 if and only if it has no prime factor congruent to 3 (mod 7) or 5 (mod 7) or 6 (mod 7) raised to an odd power. Also the power of 2 should not be 1, if it can be written in the form a^2+7*b^2.

Crossrefs

Intersection of A001481, A002479, A003136 and A020670, omitting squares. See also A216500. - N. J. A. Sloane, Sep 11 2012

Programs

  • Mathematica
    nn = 4657; lim = Floor[Sqrt[nn]]; t1 = Select[Union[Flatten[Table[a^2 + b^2, {a, lim}, {b, lim}]]], # <= nn &]; t2 = Select[Union[Flatten[Table[a^2 + 2*b^2, {a, lim}, {b, lim/Sqrt[2]}]]], # <= nn &]; t3 = Select[Union[Flatten[Table[a^2 + 3*b^2, {a, lim}, {b, lim/Sqrt[3]}]]], # <= nn &]; t7 = Select[Union[Flatten[Table[a^2 + 7*b^2, {a, lim}, {b, lim/Sqrt[7]}]]], # <= nn &]; Intersection[t1, t2, t3, t7] (* T. D. Noe, Sep 08 2012 *)

Extensions

Definition clarified by N. J. A. Sloane, Sep 11 2012

A082564 Expansion of eta(q)^2 * eta(q^2) / eta(q^4) in powers of q.

Original entry on oeis.org

1, -2, -2, 4, 2, 0, -4, 0, 2, -6, 0, 4, 4, 0, 0, 0, 2, -4, -6, 4, 0, 0, -4, 0, 4, -2, 0, 8, 0, 0, 0, 0, 2, -8, -4, 0, 6, 0, -4, 0, 0, -4, 0, 4, 4, 0, 0, 0, 4, -2, -2, 8, 0, 0, -8, 0, 0, -8, 0, 4, 0, 0, 0, 0, 2, 0, -8, 4, 4, 0, 0, 0, 6, -4, 0, 4, 4, 0, 0, 0, 0, -10, -4, 4, 0, 0, -4, 0, 4, -4, 0, 0, 0, 0, 0, 0, 4, -4, -2, 12, 2, 0, -8, 0
Offset: 0

Views

Author

Benoit Cloitre, May 05 2003

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
a(n) is nonzero if and only if n is in A002479. - Michael Somos, Dec 15 2011
Absolute values appear to give A033715 = 2*A002325.
Denoted by a_4(n) in Kassel and Reutenauer 2015. - Michael Somos, Jun 04 2015

Examples

			G.f. = 1 - 2*q - 2*q^2 + 4*q^3 + 2*q^4 - 4*q^6 + 2*q^8 - 6*q^9 + 4*q^11 + 4*q^12 + ...
		

Crossrefs

Programs

  • Magma
    A := Basis( ModularForms( Gamma1(32), 1), 105); A[1] - 2*A[2] - 2*A[3] + 4*A[4] + 2*A[5] - 4*A[7] + 2*A[9] - 6*A[10] + 4*A[12] + 4*A[13] - 4*A[16]; /* Michael Somos, Aug 29 2014 */
  • Mathematica
    a[ n_] := SeriesCoefficient[ QPochhammer[ q]^2 QPochhammer[ q^2] / QPochhammer[ q^4], {q, 0, n}]; (* Michael Somos, Aug 29 2014 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 4, 0, q] EllipticTheta[ 4, 0, q^2], {q, 0, n}]; (* Michael Somos, Aug 29 2014 *)
    a[ n_] := If[ n < 1, Boole[ n == 0], 2 (-1)^Quotient[ n + 1, 2] DivisorSum[ n, KroneckerSymbol[ -2, #] &]]; (* Michael Somos, Aug 29 2014 *)
  • PARI
    {a(n) = if( n<1, n==0, 2 * (-1)^((n+1) \ 2) * sumdiv( n, d, kronecker( -2, d)))}; /* Michael Somos, Mar 30 2007 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x + A)^2 * eta(x^2 + A) / eta(x^4 + A), n))};
    

Formula

Expansion of phi(-q) * phi(-q^2) in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Mar 30 2007
Euler transform of period 4 sequence [ -2, -3, -2, -2, ...]. - Michael Somos, Mar 30 2007
G.f. is a period 1 Fourier series which satisfies f(-1 / (32 t)) = 2^(11/2) (t/i) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A033761. - Michael Somos, Aug 29 2014
G.f.: Product_{k>0} (1 - x^k)^2 / (1 + x^(2*k)). - Michael Somos, Mar 30 2007
a(n) = -2 * A129134(n) unless n=0. - Michael Somos, Mar 30 2007
a(n) = (-1)^floor( (n+1)/2 ) * A033715(n). - Michael Somos, Aug 29 2014
a(2*n) = A133692(n). a(2*n + 1) = -2 * A125095(n). - Michael Somos, Aug 29 2014
a(3*n + 1) = -2 * A258747(n). a(3*n + 2) = -2 * A258764(n). - Michael Somos, Jun 09 2015
Previous Showing 11-20 of 48 results. Next