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 51-60 of 84 results. Next

A261904 Largest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 08 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
Somehow maximizing x seems like the right thing to do (since it is natural to try a greedy algorithm first). If we minimize x we get A261915.

Examples

			Tabls showing initial values of n,x,y,z:
0 0 0 0
1 1 0 0
2 1 1 0
3 1 1 1
4 2 0 0
5 2 1 0
6 2 1 1
7 -1 -1 -1
8 2 2 0
9 3 0 0
10 3 1 0
11 3 1 1
12 2 2 2
13 3 2 0
14 3 2 1
15 -1 -1 -1
16 4 0 0
17 4 1 0
18 4 1 1
19 3 3 1
20 4 2 0
...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

More terms from David Consiglio, Jr., Sep 08 2015

A261915 Smallest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 11 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
If we maximize x we get A261904.

Examples

			Table showing initial values of n,x,y,z:
   0  0  0  0
   1  1  0  0
   2  1  1  0
   3  1  1  1
   4  2  0  0
   5  2  1  0
   6  2  1  1
   7 -1 -1 -1
   8  2  2  0
   9  2  2  1
  10  3  1  0
  11  3  1  1
  12  2  2  2
  13  3  2  0
  14  3  2  1
  15 -1 -1 -1
  16  4  0  0
  17  3  2  2
  18  3  3  0
  19  3  3  1
  20  4  2  0
  ...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

a(17) corrected, more terms from David Consiglio, Jr., Sep 11 2015

A283269 Number of ways to write n as x^2 + y^2 + z^2 with x,y,z integers such that x + 3*y + 5*z is a square.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 04 2017

Keywords

Comments

Conjecture: (i) a(2^k*m) > 0 for any positive odd integers k and m. Also, a(4*n+1) = 0 only for n = 63.
(ii) For any positive odd integers k and m, we can write 2^k*m as x^2 + y^2 + z^2 with x,y,z integers such that x + 3*y + 5*z is twice a square.
(iii) For any positive odd integer n not congruent to 7 modulo 8, we can write n as x^2 + y^2 + z^2 with x,y,z integers such that x + 3*y + 4*z is a square.
(iv) Let n be any nonnegative integer. Then we can write 8*n + 1 as x^2 + y^2 + z^2 with x + 3*y a square, where x and y are integers, and z is a positive integer. Also, except for n = 2255, 4100 we can write 4*n + 2 as x^2 + y^2 + z^2 with x + 3*y a square, where x,y,z are integers.
(v) For each n = 0,1,2,..., we can write 8*n + 6 as x^2 + y^2 + z^2 with x + 2*y a square, where x,y,z are integers with y nonnegative and z odd.
The Gauss-Legendre theorem asserts that a nonnegative integer can be written as the sum of three squares if and only if it is not of the form 4^k*(8m+7) with k and m nonnegative integers. Thus a(4^k*(8m+7)) = 0 for all k,m = 0,1,2,....
See also A283273 for a similar conjecture.

Examples

			a(11) = 1 since 11 = 3^2 + 1^2 + (-1)^2 with 3 + 3*1 + 5*(-1) = 1^2.
a(43) = 1 since 43 = (-5)^2 + (-3)^2 + 3^2 with (-5) + 3*(-3) + 5*3 = 1^2.
a(75) = 1 since 75 = (-1)^2 + 5^2 + 7^2 with (-1) + 3*5 + 5*7 = 7^2.
a(262) = 1 since 262 = 1^2 + 15^2 + (-6)^2 with 1 + 3*15 + 5*(-6) = 4^2.
a(277) = 1 since 277 = (-6)^2 + 4^2 + 15^2 with (-6) + 3*4 + 5*15 = 9^2.
a(617) = 1 since 617 = 17^2 + 18^2 + 2^2 with 17 + 3*18 + 5*2 = 9^2.
a(1430) = 1 since 1430 = (-13)^2 + (-6)^2 + 35^2 with (-13) + 3*(-6) + 5*35 = 12^2.
a(5272) = 1 since 5272 = (-66)^2 + 30^2 + (-4)^2 with (-66) + 3*30 + 5*(-4) = 2^2.
a(7630) = 1 since 7630 = (-78)^2 + 39^2 + 5^2 with (-78) + 3*39 + 5*5 = 8^2.
a(7933) = 1 since 7933 = (-56)^2 + 69^2 + (-6)^2 with (-56) + 3*69 + 5*(-6) = 11^2.
a(14193) = 1 since 14193 = (-7)^2 + 112^2 + 40^2 with (-7) + 3*112 + 5*40 = 23^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    Do[r=0;Do[If[SQ[n-x^2-y^2]&&SQ[(-1)^i*x+(-1)^j*3y+(-1)^k*5*Sqrt[n-x^2-y^2]],r=r+1],{x,0,Sqrt[n]},{y,0,Sqrt[n-x^2]},{i,0,Min[x,1]},{j,0,Min[y,1]},{k,0,Min[Sqrt[n-x^2-y^2],1]}];Print[n," ",r];Continue,{n,0,80}]

A283273 Number of ways to write n as x^2 + y^2 + z^2 with x,y integers and z a nonnegative integer such that x + 2*y + 3*z is a square or twice a square.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 04 2017

Keywords

Comments

Conjecture: (i) For any nonnegative integer n not of the form 4^k*(8*m+7) (k,m = 0,1,2,...), we have a(n) > 0.
(ii) Any nonnegative integer not of the form 4^k*(8*m+7) (k,m = 0,1,2,...) can be written as x^2 + y^2 + z^2 with x,y,z integers such that a*x + b*y + c*z is a square or twice a square, whenever (a,b,c) is among the triples (1,2,5), (1,3,4), (1,4,7), (1,6,7), (2,3,4), (2,3,9), (3,4,7), (3,4,9).
The Gauss-Legendre theorem states that a nonnegative integer can be written as the sum of three squares if and only if it is not of the form 4^k*(8*m+7) with k and m nonnegative integers. Thus a(4^k*(8*m+7)) = 0 for all k,m = 0,1,2,..., and part (i) of our conjecture (verified for n up to 1.6*10^6) is stronger than the Gauss-Legendre theorem.
See also A283269 for a similar conjecture.

Examples

			a(82) = 1 since 82 = 0^2 + (-1)^2 + 9^2 with 0 + 2*(-1) + 3*9 = 5^2.
a(328) = 1 since 328 = 0^2 + (-2)^2 + 18^2 with 0 + 2*(-2) + 3*18 = 2*5^2.
a(330) = 1 since 330 = 5^2 + 4^2 + 17^2 with 5 + 2*4 + 3*17 = 8^2.
a(466) = 1 since 466 = 21^2 + 0^2 + 5^2 with 21 + 2*0 + 3*5 = 6^2.
a(1320) = 1 since 1320 = 10^2 + 8^2 + 34^2 with 10 + 2*8 + 3*34 = 2*8^2.
a(1387) = 1 since 1387 = 33^2  + (-17)^2 + 3^2 with 33 + 2*(-17) + 3*3 = 2*2^2.
a(1857) = 1 since 1857 = (-37)^2 + (-2)^2 + 22^2 with (-37) + 2*(-2) + 3*22 = 5^2.
a(1864) = 1 since 1864 = 42^2 + 0^2 + 10^2 with 42 + 2*0 + 3*10 = 2*6^2.
a(2386) = 1 since 2386 = (-44)^2 + 3^2 + 21^2 with (-44) + 2*3 + 3*21 = 5^2.
a(5548) = 1 since 5548 = 66^2 + (-34)^2 + 6^2 with 66 + 2*(-34) + 3*6 = 4^2.
a(7428) = 1 since 7428 = (-74)^2 + (-4)^2 + 44^2 with (-74) + 2*(-4) + 3*44 = 2*5^2.
a(9544) = 1 since 9544 = (-88)^2 + 6^2 + 42^2 with (-88) + 2*6 + 3*42 = 2*5^2.
		

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    TQ[n_]:=TQ[n]=SQ[n]||SQ[2n];
    Do[r=0;Do[If[SQ[n-x^2-y^2]&&TQ[(-1)^i*x+(-1)^j*2y+3*Sqrt[n-x^2-y^2]],r=r+1],{x,0,Sqrt[n]},{y,0,Sqrt[n-x^2]},{i,0,Min[x,1]},{j,0,Min[y,1]}];Print[n," ",r];Continue,{n,0,80}]

A294710 Numbers that are the sum of three squares (square 0 allowed) in exactly seven ways.

Original entry on oeis.org

306, 314, 341, 441, 450, 458, 494, 506, 581, 585, 593, 605, 654, 657, 674, 698, 706, 726, 731, 738, 746, 773, 806, 842, 850, 873, 890, 891, 893, 894, 899, 901, 905, 906, 934, 978, 985, 998, 1011, 1013, 1019, 1050, 1058, 1061, 1067, 1073, 1086, 1094, 1101
Offset: 1

Views

Author

Robert Price, Nov 07 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 7.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly seven ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 7 &]

Extensions

Updated Mathematica program to Version 11. by Robert Price, Nov 01 2019

A004008 Expansion of theta series of E_7 lattice in powers of q^2.

Original entry on oeis.org

1, 126, 756, 2072, 4158, 7560, 11592, 16704, 24948, 31878, 39816, 55944, 66584, 76104, 99792, 116928, 133182, 160272, 177660, 205128, 249480, 265104, 281736, 350784, 382536, 390726, 470232, 505568, 532800, 615384, 640080, 701568, 799092, 809424, 853776
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = 1 + 126*x + 756*x^2 + 2072*x^3 + 4158*x^4 + 7560*x^5 + 11592*x^6 + ...
G.f. = 1 + 126*q^2 + 756*q^4 + 2072*q^6 + 4158*q^8 + 7560*q^10 + 11592*q^12 + ...
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 125. Equation (112)
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    A := Basis( ModularForms( Gamma0(4), 7/2), 50); A[1] + 126*A[2]; /* Michael Somos, Jun 09 2014 */
  • Mathematica
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3 ( 8 EllipticTheta[ 3, 0, q]^4 - 7 EllipticTheta[ 4, 0, q]^4), {q, 0, n}]; (* Michael Somos, Aug 27 2013 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3 ( EllipticTheta[ 3, 0, q]^4 + 7 EllipticTheta[ 2, 0, q]^4), {q, 0, n}]; (* Michael Somos, Apr 21 2015 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = sum(k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n)); polcoeff( A^3 * (8 * A^4 - 7 * subst(A, x, -x)^4), n))}; /* Michael Somos, Oct 24 2006 */
    
  • PARI
    {a(n) = my(G); if( n<1, n==0, G = [2, -1, 0, 0, 0, 0, 0; -1, 2, -1, 0, 0, 0, 0; 0, -1, 2, -1, 0, 0, 0; 0, 0, -1, 2, -1, 0, -1; 0, 0, 0, -1, 2, -1, 0; 0, 0, 0, 0, -1, 2, 0; 0, 0, 0, -1, 0, 0, 2]; 2 * qfrep( G, n, 1)[n])}; /* Michael Somos, Jun 11 2007 */
    

Formula

Expansion of phi(q)^3 * (phi(q)^4 + 7 * 16 * q * psi(q^2)^4) in powers of q where phi(), psi() are Ramanujan theta functions. - Michael Somos, Oct 24 2006
G.f. is a period 1 Fourier series which satisfies f(-1 / (4 t)) = 2^(1/2) (t / i)^(7/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A003781. - Michael Somos, Aug 27 2013
Convolution of A005875 and A228746. - Michael Somos, Apr 21 2015

A071611 Number of points (i,j,k) on the surface of a sphere around (0,0,0) with squared radius A071609(n).

Original entry on oeis.org

6, 12, 24, 30, 48, 72, 96, 120, 144, 168, 192, 240, 264, 312, 336, 384, 408, 432, 480, 504, 528, 552, 576, 600, 672, 696, 720, 768, 816, 864, 936, 1008, 1032, 1056, 1104, 1200, 1248, 1296, 1344, 1440, 1512, 1584, 1680, 1704, 1752, 1848, 1920, 2016
Offset: 1

Views

Author

Hugo Pfoertner, May 25 2002

Keywords

Comments

a(n) is the number of lattice points on a sphere around (0,0,0) with r^2 = A071609(n).

Examples

			A sphere with radius 1 has 6 lattice points on its surface, so a(1)=6. A sphere with r=sqrt(2) passes through 12 lattice points of the shape (1,1,0), so a(2)=12. A sphere with r=sqrt(5) passes through 24 lattice points with shape (2,1,0), so a(3)=24. A sphere with r=sqrt(9) passes through 6 lattice points of shape (3,0,0) and through 24 lattice points of shape (2,2,1), so a(4)=6+24=30.
		

Crossrefs

Formula

a(n) = A005875(A071609(n)). - Daniel Suteu, Aug 13 2021

A133102 Number of partitions of n^3 into n distinct nonzero squares.

Original entry on oeis.org

1, 0, 0, 0, 0, 3, 5, 20, 56, 112, 268, 618, 1922, 8531, 29021, 100407, 321531, 899618, 2937312, 9295401, 31615059, 117365818, 403433963, 1417579281, 4848439367, 15960316056, 55180971700, 190251417034, 670818005444, 2429973932322
Offset: 1

Views

Author

Hugo Pfoertner, Sep 12 2007

Keywords

Examples

			a(6) = 3 because there are 3 ways to express 6^3 = 216 as a sum of 6 distinct nonzero squares: 216 = 1^2 + 2^2 + 4^2 + 5^2 + 7^2 + 11^2 = 1^2 + 3^2 + 5^2 + 6^2 + 8^2 + 9^2 = 3^2 + 4^2 + 5^2 + 6^2 + 7^2 + 9^2.
		

Crossrefs

Cf. A133103 (number of ways to express n^3 as a sum of n nonzero squares), A133105 (number of ways to express n^4 as a sum of n distinct nonzero squares).

Programs

  • PARI
    a(i, n, k)=local(s, j); if(k==1, if(issquare(n) && n
    				

Extensions

2 more terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 16 2007
More terms from Robert Gerbicz, May 09 2008

A133103 Number of partitions of n^3 into n nonzero squares.

Original entry on oeis.org

1, 1, 2, 1, 10, 34, 156, 734, 3599, 18956, 99893, 548373, 3078558, 17510598, 101960454, 599522778, 3565904170, 21438347021, 129905092421, 794292345434, 4890875249113, 30326545789640, 189195772457341, 1187032920371427
Offset: 1

Views

Author

Hugo Pfoertner, Sep 11 2007

Keywords

Examples

			a(2)=1 because the only way to express 2^3 = 8 as a sum of two squares is 8 = 2^2 + 2^2.
a(3)=2 because 3^3 = 27 = 1^2 + 1^2 + 5^2 = 3^2 + 3^2 + 3^2.
		

Crossrefs

Cf. A133102 (number of ways to express n^3 as a sum of n distinct nonzero squares), A133104 (number of ways to express n^4 as a sum of n nonzero squares).

Programs

  • PARI
    a(i, n, k)=local(s, j); if(k==1, if(issquare(n), return(1), return(0)), s=0; for(j=ceil(sqrt(n/k)), min(i, floor(sqrt(n-k+1))), s+=a(j, n-j^2, k-1)); return(s)) for(n=1,50, m=n^3; k=n; print1(a(m, m, k)", ") ) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 16 2007

Extensions

2 more terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 16 2007
More terms from Robert Gerbicz, May 09 2008

A133105 Number of partitions of n^4 into n distinct nonzero squares.

Original entry on oeis.org

1, 0, 1, 0, 21, 266, 2843, 55932, 884756, 13816633, 283194588, 5375499165, 125889124371, 3202887665805, 80542392920980, 2270543992935431, 64253268814048352, 1892633465941308859, 59116753827795287519, 1886846993941912938452
Offset: 1

Views

Author

Hugo Pfoertner, Sep 12 2007

Keywords

Examples

			a(3)=1 because there is exactly one way to express 3^4 as the sum of 3 distinct nonzero squares: 81 = 1^2 + 4^2 + 8^2.
		

Crossrefs

Cf. A133104 (number of ways to express n^4 as a sum of n nonzero squares), A133102 (number of ways to express n^3 as a sum of n distinct nonzero squares).

Programs

  • PARI
    a(i, n, k)=local(s, j); if(k==1, if(issquare(n) && n
    				

Extensions

a(10) from Herman Jamke (hermanjamke(AT)fastmail.fm), Dec 16 2007
a(11) onwards from Robert Gerbicz, May 09 2008
Previous Showing 51-60 of 84 results. Next