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.

Showing 1-10 of 36 results. Next

A300219 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 both x and 4*x - 3*y are powers of 4 (including 4^0 = 1).

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Feb 28 2018

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 0, and a(n) = 1 only for n = 4^k*m (k = 0,1,2,... and m = 1, 2, 3, 5, 15, 37, 83, 263). Also, for each n = 2,3,... we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and 4*x - 3*y lie in the set {2^(2k+1): k = 0,1,...}.
(ii) Let r be 0 or 1, and let n > r. Then n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that both x and x + 3*y belong to the set {2^(2k+r): k = 0,1,2,...}, unless n has the form 2^(2k+r)*81503 with k a nonnegative integer and hence n^2 = (2^(2k+r)*28^2)^2 + (2^(2k+r)*80)^2 + (2^(2k+r)*55937)^2 + (2^(2k+r)*59272)^2 with 2^(2k+r)*28^2 = 2^r*(2^k*28)^2 and 2^(2k+r)*28^2 + 3*(2^(2k+r)*80) = 2^(2(k+5)+r). So we always can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x/2^r is a square and (x+3*y)/2^r is a power of 4.
In arXiv:1701.05868 the author proved that for each r = 0,1 and n > r we can write n^2 as (2^(2k+r))^2 + x^2 + y^2 + z^2 with k,x,y,z nonnegative integers.
We have verified both parts of the conjecture for n up to 10^7.

Examples

			a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 4*1 - 3*1 = 4^0.
a(3) = 1 since 3^2 = 1^2 + 0^2 + 2^2 + 2^2 with 1 = 4^0 and 4*1 - 3*0 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4*4 - 3*0 = 4^2.
a(15) = 1 since 15^2 = 4^2 + 4^2 + 7^2 + 12^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1.
a(37) = 1 since 37^2 = 16^2 + 16^2 + 4^2 + 29^2 with 16 = 4^2 and 4*16 - 3*16 = 4^2.
a(83) = 1 since 83^2 = 4^2 + 4^2 + 56^2 + 61^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1.
a(263) = 1 since 263^2 = 4^2 + 5^2 + 22^2 + 262^2 with 4 = 4^1 and 4*4 - 3*5 = 4^0.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Do[r=0;Do[If[SQ[n^2-16^k-((4^(k+1)-4^m)/3)^2-z^2],r=r+1],{k,0,Log[4,n]},{m,Ceiling[Log[4,Max[1,4^(k+1)-3*Sqrt[n^2-16^k]]]],k+1},{z,0,Sqrt[(n^2-16^k-((4^(k+1)-4^m)/3)^2)/2]}];Print[n," ",r];Label[aa],{n,1,80}]

A303233 Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 2^c + 2^d, where a,b,c,d are nonnegative integers with a <= b and c <= d.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 20 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1. In other words, any integer n > 1 can be written as the sum of two triangular numbers and two powers of 2.
a(n) > 0 for all n = 2..10^9. See A303234 for numbers of the form x*(x+1)/2 + 2^y with x and y nonnegative integers. See also A303363 for a stronger conjecture.
In contrast, Crocker proved in 2008 that there are infinitely many positive integers not representable as the sum of two squares and at most two powers of 2.

Examples

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

References

  • R. C. Crocker, On the sum of two squares and two powers of k, Colloq. Math. 112(2008), 235-267.

Crossrefs

Programs

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

A303363 Number of ways to write n as a*(a+1)/2 + b*(b+1)/2 + 2^c + 2^d, where a,b,c,d are nonnegative integers with a <= b, c <= d and 2|c.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 22 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.
This is stronger than the author's conjecture in A303233. I have verified a(n) > 0 for all n = 2..10^9.
In contrast, Corcker proved in 2008 that there are infinitely many positive integers not representable as the sum of two squares and at most two powers of 2.

Examples

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

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 22 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3.
This is stronger than the author's previous conjecture in A302983. It has been verified that a(n) > 0 for all n = 4..10^9.
Jiao-Min Lin (a student at Nanjing University) has found a counterexample to the conjecture: a(12558941213) = 0. - Zhi-Wei Sun, Jul 30 2022

Examples

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

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

A299537 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 or y is a power of 4 (including 4^0 = 1) and x + 3*y is also a power of 4.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 04 2018

Keywords

Comments

Conjecture (i): a(n) > 0 for all n > 0, and a(n) = 1 only for n = 4^k*m with k = 0,1,2,... and m = 1, 2, 3, 5, 7, 11, 15, 19, 43, 47, 135, 1103.
Conjecture (ii): For any integer n > 1, we can write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 2*x or 2*y is a power of 4 and 2*(x+3*y) is also a power of 4.
Note that 81503^2 cannot be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and both x and x + 3*y in the set {4^k: k = 0,1,2,...}. However, 81503^2 = 16372^2 + 4^2 + 52372^2 + 60265^2 with 4 = 4^1 and 16372 + 3*4 = 4^7.
We have verified that the conjecture for n up to 10^7.
See also the related comments in A300219 and A300360, and a similar conjecture in A299794.

Examples

			a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 1 + 3*1 = 4^1.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4 + 3*0 = 4^1.
a(19) = 1 since 19^2 = 1^2 + 0^2 + 6^2 + 18^2 with 1 = 4^0 and 1 + 3*0 = 4^0.
a(43) = 1 since 43^2 = 4^2 + 20^2 + 8^2 + 37^2 with 4 = 4^1 and 4 + 3*20 = 4^3.
a(135) = 1 since 135^2 = 16^2 + 16^2 + 17^2 + 132^2 with 16 = 4^2 and 16 + 3*16 = 4^3.
a(1103) = 1 since 1103^2 = 4^2 + 4^2 + 716^2 + 839^2 with 4 = 4^1 and 4 + 3*4 = 4^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]];
    tab={};Do[r=0;Do[If[(Pow[y]||Pow[4^k-3y])&&SQ[n^2-y^2-(4^k-3y)^2-z^2],r=r+1],{k,0,Log[4,Sqrt[10]*n]},{y,0,Min[n,4^k/3]},{z,0,Sqrt[Max[0,(n^2-y^2-(4^k-3y)^2)/2]]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A299794 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x >= y >= 0 <= z <= w such that x or 2*y is a power of 4 (including 4^0 = 1) and x + 15*y is also a power of 4.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 04 2018

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 0. Also, for any integer n > 1 we can write n^2 as x^2 + y^2 + z^2 + w^2 with x >= y >= 0 <= z <= w such that 2*x or y is a power of 4 and also x + 15*y = 2^(2k+1) for some k = 0,1,2,....
Conjecture 2: Let d be 2 or 8, and let r be 0 or 1. Then any positive square n^2 can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x or y is a power of 2 and x + d*y = 2^(2k+r) for some k = 0,1,2,....
We have verified Conjecture 1 for n up to 10^7.
See also A299537, A300219 and A300396 for similar conjectures.

Examples

			a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 1 + 15*1 = 4^2.
a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4 + 15*0 = 4^1.
a(19) = 1 since 19^2 = 1^2 + 0^2 + 6^2 + 18^2 with 1 = 4^0 and 1 + 15*0 = 4^0.
a(159) = 1 since 159^2 = 34^2 + 2^2 + 75^2 + 136^2 with 2*2 = 4^1 and 34 + 15*2 = 4^3.
a(1998) = 1 since 1998^2 = 256^2 + 256^2 + 286^2 + 1944^2 with 256 = 4^4 and 256 + 15*256 = 4^6.
a(3742) = 1 since 3742^2 = 2176^2 + 128^2 + 98^2 + 3040^2 with 2*128 = 4^4 and 2176 + 15*128 = 4^6.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]];
    tab={};Do[r=0;Do[If[Pow[2y]||Pow[4^k-15y],Do[If[SQ[n^2-y^2-(4^k-15y)^2-z^2],r=r+1],{z,0,Sqrt[Max[0,(n^2-y^2-(4^k-15y)^2)/2]]}]],
    {k,0,Log[4,Sqrt[226]*n]},{y,0,Min[n,4^(k-2)]}];tab=Append[tab,r],{n,1,80}];Print[tab]

A300362 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 2*y and (z + 2*w)/3 are squares and w is even.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 04 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n = 0,1,2,..., and a(n) = 1 only for n = 0, 7, 9, 14, 19, 22, 26, 34, 41, 4^k*m (k = 0,1,... and m = 1, 2, 3, 5, 10, 11, 13, 15).

Examples

			 a(9) = 1 since 9^2 = 9^2 + 0^2 + 0^2 + 0^2 with 9 + 2*0 = 3^2 and 0 + 2*0 = 3*0^2.
a(13) = 1 since 13^2 = 4^2 + 0^2 + 3^2 + 12^2 with 4 + 2*0 = 2^2 and 3 + 2*12 = 3*3^2.
a(14) = 1 since 14^2 = 4^2 + 6^2 + 12^2 + 0^2 with 4 + 2*6 = 4^2 and 12 + 2*0 = 3*2^2.
a(15) = 1 since 15^2 = 9^2 + 0^2 + 12^2 + 0^2 with 9 + 2*0 = 3^2 and 12 + 2*0 = 3*2^2.
a(41) = 1 since 41 = 38^2 + 13^2 + 8^2 + 2^2 with 38 + 2*13 = 8^2 and 8 + 2*2 = 3*2^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[r=0;Do[If[SQ[x+2y]&&SQ[(n^2-x^2-y^2-z^2)/4]&&SQ[(z+2*Sqrt[n^2-x^2-y^2-z^2])/3],r=r+1],{x,0,n},{y,0,Sqrt[n^2-x^2]},{z,0,Sqrt[n^2-x^2-y^2]}];tab=Append[tab,r],{n,0,80}];Print[tab]

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[r=0;Do[If[SQ[n-3*2^k-2^j-5x^2],r=r+1],{k,0,Log[2,n/3]},{j,0,If[n==3*2^k,-1,Log[2,n-3*2^k]]},{x,0,Sqrt[(n-3*2^k-2^j)/5]}];tab=Append[tab,r],{n,1,60}];Print[tab]

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

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Apr 16 2018

Keywords

Comments

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

Examples

			a(6) = 1 with 6 = 0^2 + 2*0^2 + 2^0 + 5*2^0.
a(7) = 2 with 7 = 1^2 + 2*0^2 + 2^0 + 5*2^0 = 0^2 + 2*0^2 + 2^1 + 5*2^0.
a(8) = 2 with 8 = 0^2 + 2*1^2 + 2^0 + 5*2^0 = 1^2 + 2*0^2 + 2^1 + 5*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-5*2^k-2^j],Do[If[SQ[n-5*2^k-2^j-2x^2],r=r+1],{x,0,Sqrt[(n-5*2^k-2^j)/2]}]],{k,0,Log[2,n/5]},{j,0,Log[2,Max[1,n-5*2^k]]}];tab=Append[tab,r],{n,1,60}];Print[tab]

A303234 Numbers of the form x*(x+1)/2 + 2^y with x and y nonnegative integers.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 22, 23, 25, 26, 29, 30, 31, 32, 33, 35, 36, 37, 38, 40, 42, 44, 46, 47, 49, 52, 53, 56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 70, 71, 74, 77, 79, 80
Offset: 1

Views

Author

Zhi-Wei Sun, Apr 20 2018

Keywords

Comments

Conjecture: Any integer n > 1 can be written as the sum of two terms of the current sequence.
This is equivalent to the author's conjecture in A303233.

Examples

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

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[Do[If[SQ[8(n-2^k)+1],tab=Append[tab,n];Goto[aa]],{k,0,Log[2,n]}];Label[aa],{n,1,80}];Print[tab]
Showing 1-10 of 36 results. Next