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

A301376 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that x^2-(3*y)^2 = 4^k for some k = 0,1,2,....

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 19 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Moreover, any positive square n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w integers and y even such that x^2 - (3*y)^2 = 4^k for some k = 0,1,2,....
We have verifed this for all n = 1..10^7.
Compare this conjecture with the conjectures in A299537.
As 3*A001353(n)^2 + 1 = A001075(n)^2, the conjecture in A300441 implies that any positive square can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w integers such that x^2 - 3*y^2 = 4^k for some k = 0,1,2,....
See also A301391 for a similar conjecture.

Examples

			a(1) = 1 since 1^2 = 1^2 + 0^2 + 0^2 + 0^2 with 1^2 - (3*0)^2 = 4^0.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4^2 - (3*0)^2 = 4^2.
a(7) = 1 since 7^2 = 2^2 + 0^2 + 3^2 + 6^2 with 2^2 - (3*0)^2 = 4^1.
a(31) = 3 since 31^2 = 10^2 + 2^2 + 4^2 + 29^2 with 10^2 - (3*2)^2 = 4^3, and 31^2 = 20^2 + 4^2 + 4^2 + 23^2 = 20^2 + 4^2 + 16^2 + 17^2 with 20^2 - (3*4)^2 = 4^4.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n],i],1]-3,4]==0&&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[SQ[4^k+9y^2]&&QQ[n^2-4^k-10y^2],Do[If[SQ[n^2-(4^k+10y^2)-z^2],r=r+1],{z,0,Sqrt[(n^2-4^k-10y^2)/2]}]],{k,0,Log[2,n]},{y,0,Sqrt[(n^2-4^k)/10]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A301391 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and y even such that x^2 - (6*y)^2 = 4^k for some k = 0,1,2,....

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 20 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 11, 13, 19, 2^k*m (k = 0,1,2,... and m = 1, 5, 7, 31).
We have verified a(n) > 0 for all n = 1..10^7.
See also A301376 for a similar conjecture.

Examples

			a(2) = 1 since 2^2 = 2^2 + 0^2 + 0^2 + 0^2 with 2^2 - (6*0)^2 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4^2 - (6*0)^2 = 4^2.
a(7) = 1 since 7^2 = 2^2 + 0^2 + 3^2 + 6^2 with 2^2 - (6*0)^2 = 4^1.
a(11) = 1 since 11 = 2^2 + 0^2 + 6^2 + 9^2 with 2^2 - (6*0)^2 = 4^1.
a(13) = 1 since 13 = 4^2 + 0^2 + 3^2 + 12^2 with 4^2 - (6*0)^2 = 4^2.
a(19) = 1 since 19 = 1^2 + 0^2 + 6^2 + 18^2 with 1^2 - (6*0)^2 = 4^0.
a(31) = 1 since 31^2 = 20^2 + 2^2 + 14^2 + 19^2 with 20^2 - (6*2)^2 = 4^4.
a(75) = 2 since 75^2 = 68^2 + 10^2 + 1^2 + 30^2 = 68^2 + 10^2 + 15^2 + 26^2 with 68^2 - (6*10)^2 = 4^5.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n],i],1]-3,4]==0&&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[SQ[4^k+144m^2]&&QQ[n^2-4^k-148m^2], Do[If[SQ[n^2-(4^k+148m^2)-z^2],r=r+1],{z,0,Sqrt[(n^2-4^k-148m^2)/2]}]],{k,0,Log[2,n]},{m,0,Sqrt[(n^2-4^k)/148]}];tab=Append[tab,r],{n,1,80}];Print[tab]

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]

A300441 Number of the integers 4^k*(4*u(m)^2+1) (k,m = 0,1,2,...) such that n^2 - 4^k*(4*u(m)^2+1) can be written as the sum of two squares, where u(0) = 0, u(1) = 1, and u(j+1) = 4*u(j) - u(j-1) for j = 1,2,3,....

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 05 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0, and a(n) = 1 only for n = 2^k*m (k = 0,1,2,... and m = 1, 7).
This curious conjecture indicates that any positive square can be written as (2^k)^2 + (2^(k+1)*u(m))^2 + x^2 + y^2 with k,m,x,y nonnegative integers. In the 2017 JNT paper, the author proved that each n = 1,2,3,... can be written as 4^k*(1+4*x^2+y^2)+z^2 with k,x,y,z nonnegative integers.
We have verified that a(n) > 0 for all n = 1..10^7.

Examples

			a(1) = 1 since 1^2 - 4^0*(4*u(0)^2+1) = 1 is 1^2 + 0^2.
a(5) = 3 since 5^2 - 4^0*(4*u(1)^2+1) = 20 = 4^2 + 2^2, 5^2 - 4^1*(4*u(1)^2+1) = 5 = 2^2 + 1^2, and 5^2 - 4^2*(4*u(0)^2+1) = 9 = 3^2 + 0^2.
a(7) = 1 since 7^2 - 4^1*(4*u(0)^2+1) = 45 = 6^2 + 3^2.
		

Crossrefs

Programs

  • Mathematica
    u[0]=0;
    u[1]=1;
    u[n_]:=u[n]=4u[n-1]-u[n-2];
    f[n_]:=f[n]=FactorInteger[n];
    g[n_]:=g[n]=Sum[If[Mod[Part[Part[f[n],i],1]-3,4]==0&&Mod[Part[Part[f[n],i],2],2]==1,1,0],{i,1,Length[f[n]]}]==0;
    QQ[n_]:=QQ[n]=n==0||(n>0&&g[n]);
    tab={};Do[r=0;Do[m=0;Label[cc];If[4u[m]^2+1>n^2/4^k,Goto[bb]];If[QQ[n^2-4^k*(4u[m]^2+1)],r=r+1,m=m+1;Goto[cc]];
    Label[bb],{k,0,Log[2,n]}];tab=Append[tab,r],{n,1,80}];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]

A300510 Number of ways to write n^2 as 4^k*(m^2+1) + x^2 + y^2, where m is 1 or 2, and k,x,y are nonnegative integers with x <= y.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 07 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1; in other words, for any integer n > 1 there is a nonnegative integer k such that either n^2 - 2*4^k or n^2 - 5*4^k can be written as the sum of two squares. Moreover, a(n) = 1 only for n = 2^k with k > 0.
This conjecture is stronger than the first conjecture in A300448. We have verified that a(n) > 0 for all n = 2..5*10^7.
Consider positive integers c not divisible by 4 such that for any integer n > 1 there is a nonnegative integer k for which n^2 - 2*4^k or n^2 - c*4^k can be written as the sum of two squares. Our computation for n up to 3*10^7 shows that the only candidates for values of c smaller than 160 are 5, 17, 18, 26, 29, 41, 45, 65, 74, 89, 98, 101, 113, 122, 125, 146, 149, 153. These numbers have the form 9^a*(3*b+2) with a and b nonnegative integers and the p-adic order of 3*b+2 is even for any prime p == 3 (mod 4). For n = 42211965 there is no nonnegative integer k such that n^2 - 2*4^k or n^2 - 162*4^k can be written as the sum of two squares.
Qing-Hu Hou at Tianjin Univ. reported that he had verified a(n) > 0 for n up to 10^9. - Zhi-Wei Sun, Mar 14 2018
Qing-Hu Hou found that 29, 65, 113 should be excluded from the candidates. In fact, for c = 29, 65, 113 there is no nonnegative integer k such that N(c)^2 - 2*4^k or N(c)^2 - c*4^k can be written as the sum of two squares, where N(29) = 51883659, N(65) = 56173837 and N(113) = 65525725. - Zhi-Wei Sun, Mar 23 2018
a(n) > 0 for 1 < n < 6*10^9. - Giovanni Resta, Jun 14 2019

Examples

			a(1) = 0 since 1^2 - 4^k*(m^2+1) < 0 for k = 0,1,2,... and m = 1, 2.
a(2) = 1 since 2^2 = 4^0*(1^2+1) + 1^2 + 1^2.
a(3) = 2 since 3^2 = 4^0*(2^2+1) + 0^2 + 2^2 = 4^1*(1^2+1) + 0^2 + 1^2.
		

Crossrefs

Programs

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

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