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

A004539 Expansion of sqrt(2) in base 2.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Bailey, Borwein, Crandall, & Pomerance prove a general result that the first n terms contain >> sqrt(n) 1's. Vandehey improves this to sqrt(2*n)(1 + o(1)). - Charles R Greathouse IV, Nov 07 2017

Examples

			1.0110101000001001111001...
		

Crossrefs

Cf. A002193 (decimal version), A233836 (run lengths of 0's and 1's).

Programs

  • Haskell
    a004539 n = a004539_list !! (n-1)
    a004539_list = w 2 0 where
       w x r = bit : w (4 * (x - (4 * r + bit) * bit)) (2 * r + bit)
         where bit = head (dropWhile (\b -> (4 * r + b) * b < x) [0..]) - 1
    -- Reinhard Zumkeller, Dec 16 2013
    
  • Mathematica
    N[Sqrt[2], 200]; RealDigits[%, 2]
    RealDigits[Sqrt[2],2,120][[1]] (* Harvey P. Dale, Aug 03 2024 *)
  • PARI
    binary(sqrt(2)) \\ Michel Marcus, Nov 06 2017
    
  • PARI
    a(n) = floor(quadgen(8)<<(n-1))%2; \\ Chittaranjan Pardeshi, Sep 09 2024
  • bc
    obase=2 scale=200 sqrt(2)
    

Formula

a(k) = floor(Sum_{n>=1} A005875(n)/exp(Pi*n/(2^((2/3)*k+(1/3))))) mod 2. Will give the k-th binary digit of sqrt(2). A005875 : number of ways to write n as sum of 3 squares. - Simon Plouffe, Dec 30 2023

A066535 Number of ways of writing n as a sum of n squares.

Original entry on oeis.org

1, 2, 4, 8, 24, 112, 544, 2368, 9328, 34802, 129064, 491768, 1938336, 7801744, 31553344, 127083328, 509145568, 2035437440, 8148505828, 32728127192, 131880275664, 532597541344, 2153312518240, 8710505815360, 35250721087168, 142743029326162, 578472382307304
Offset: 0

Views

Author

Peter Bertok (peter(AT)bertok.com), Jan 07 2002

Keywords

Examples

			There are a(3) = 8 solutions (x,y,z) of 3 = x^2 + y^2 + z^2: (1,1,1), (-1,-1,-1), 3 permutations of (1,1,-1) and 3 permutations of (1,-1,-1).
		

Crossrefs

Cf. A122141, A166952. - Paul D. Hanna, Oct 25 2009
a(n^2) gives A361431.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n=0, 1, `if`(n<0 or t<1, 0,
          b(n, t-1) +2*add(b(n-j^2, t-1), j=1..isqrt(n))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 16 2014
  • Mathematica
    Join[{1}, Table[SquaresR[n, n], {n, 24}]]
  • PARI
    {a(n)=local(THETA3=1+2*sum(k=1,sqrtint(n),x^(k^2))+x*O(x^n)); polcoeff(THETA3^n, n)} /* Paul D. Hanna, Oct 25 2009 */

Formula

a(n) equals the coefficient of x^n in the n-th power of Jacobi theta_3(x) where theta_3(x) = 1 + 2*Sum_{n>=1} x^(n^2). - Paul D. Hanna, Oct 25 2009
a(n) ~ c * d^n / sqrt(n), where d = 4.13273137623493996302796465... (= 1/radius of convergence A166952), c = 0.2820942036723951157919967... . - Vaclav Kotesovec, Sep 12 2014

Extensions

Edited by Dean Hickerson, Jan 12 2002
a(0) added by Paul D. Hanna, Oct 25 2009
Edited by R. J. Mathar, Oct 29 2009

A117609 Number of lattice points inside the ball x^2 + y^2 + z^2 <= n.

Original entry on oeis.org

1, 7, 19, 27, 33, 57, 81, 81, 93, 123, 147, 171, 179, 203, 251, 251, 257, 305, 341, 365, 389, 437, 461, 461, 485, 515, 587, 619, 619, 691, 739, 739, 751, 799, 847, 895, 925, 949, 1021, 1021, 1045, 1141, 1189, 1213, 1237, 1309, 1357, 1357, 1365, 1419, 1503
Offset: 0

Views

Author

John L. Drost, Apr 06 2006

Keywords

Examples

			a(2) = 1 + 6 + 12 = 19, since (0,0,0) and (0, 0, +-1) and cyclic permutations (for a total of 6 points), and +-(0, 1, +-1) and cyclic permutations (for a total 12 points) are inside or on x^2 + y^2 + z^2 = 2.
		

Crossrefs

Partial sums of A005875.
Cf. A000605 (number of points of norm <= n in cubic lattice).
Cf. A210639, A000092 and references therein.
Cf. A057655.

Programs

  • Mathematica
    Table[Sum[SquaresR[3,k], {k,0,n}], {n,0,50}] (* T. D. Noe, Apr 08 2006, revised Sep 27 2011 *)
  • PARI
    A117609(n)=sum(x=0,sqrtint(n),(sum(y=1,sqrtint(t=n-x^2),1+2*sqrtint(t-y^2))*2+sqrtint(t)*2+1)*2^(x>0)) \\ M. F. Hasler, Mar 26 2012
    
  • PARI
    q='q+O('q^66); Vec((eta(q^2)^5/(eta(q)^2*eta(q^4)^2))^3/(1-q)) /* Joerg Arndt, Apr 08 2013 */
    
  • Python
    # uses Python code for A057655
    from math import isqrt
    def A117609(n): return A057655(n)+(sum(A057655(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 23 2024

Formula

a(n) ~ (4/3)*Pi*n^(3/2) ~ A210639(n).
a(n) = A122510(3,n). - R. J. Mathar, Apr 21 2010
G.f.: T3(q)^3/(1-q) where T3(q) = 1 + 2*Sum_{k>=1} q^(k^2). - Joerg Arndt, Apr 08 2013
a(n^2) = A000605(n). - R. J. Mathar, Aug 03 2025

A085469 Decimal expansion of Madelung constant (negated) for NaCl structure.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Jul 01 2003

Keywords

Comments

This is the electrostatic potential at the origin produced by unit charges of sign (-1)^(i+j+k) at all nonzero lattice points (i,j,k).
The NaCl structure consists of two interpenetrating face-centered cubic lattices of ions with charges +1 and -1, together occupying all the sites of the simple cubic lattice. - Andrey Zabolotskiy, Oct 21 2019
Named after the German physicist Erwin Madelung (1881-1972). - Amiram Eldar, Apr 02 2022

Examples

			-1.7475645946331821906362120355443974034851614366247417581528253507...
		

References

  • Richard E. Crandall, Topics in Advanced Scientific Computation, Springer, Telos books, 1996, pages 73-79.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 76.
  • Sadri Hassani, Mathematical Methods Using Mathematica: For Students of Physics and Related Fields, Springer, NY, page 60.

Crossrefs

Cf. A004015, A005875, A108778 (continued fraction).

Programs

  • Mathematica
    RealDigits[ 12Pi*Sum[ Sech[Pi/2*Sqrt[(2j + 1)^2 + (2k + 1)^2]]^2, {j, 0, 40}, {k, 0, 40}], 10, 111][[1]] (* Robert G. Wilson v, Jul 12 2005 *)
    RealDigits[Quiet[12 Pi (Sech[Pi/Sqrt[2]]^2 + NSum[Sum[Sech[Pi Norm[2 v + 1]/2]^2, {v, FrobeniusSolve[{1, 1}, Round[m]]}, Method -> "Procedural"], {m, 1, Infinity}, Compiled -> False, Method -> "WynnEpsilon", NSumTerms -> 33, WorkingPrecision -> 100])]][[1]] (* Jan Mangaldan, Jun 25 2020 *)
    digits = 1800; m0 = 800; dm = 10; dd = 10; Clear[f, g];
    g[j_, k_] := g[j, k] = 12 Pi Sech[(Pi/2) Sqrt[(2j + 1)^2 + (2k + 1)^2]]^2 // N[#, digits + dd]&;
    f[m_] := f[m] =  Sum[g[j, k], {j, 0, m}, {k, 0, m}];
    f[m = m0]; f[m += dm];
    While[Abs[f[m] - f[m - dm]] > 10^(-digits - dd), Print[m]; m += dm];
    A085469 = f[m];
    RealDigits[A085469, 10, digits][[1]] (* Jean-François Alcover, May 08 2021, after Robert G. Wilson v *)
  • PARI
    Madelung()=my(c=Pi/2,d=asech(2^-default(realbitprecision))\/c+1); sum(j=0,d, sum(k=0,d, sech(c*sqrt((2*j+1)^2+(2*k+1)^2))),0.)*12*Pi \\ Charles R Greathouse IV, Feb 07 2025

Formula

Sum_{i, j, k not all 0} (-1)^(i+j+k)/sqrt(i^2+j^2+k^2).

Extensions

Entry revised by N. J. A. Sloane, Apr 12 2004
Definition corrected by Leslie Glasser, Jan 24 2011
Definition corrected by Andrey Zabolotskiy, Oct 21 2019

A004015 Theta series of face-centered cubic (f.c.c.) lattice.

Original entry on oeis.org

1, 12, 6, 24, 12, 24, 8, 48, 6, 36, 24, 24, 24, 72, 0, 48, 12, 48, 30, 72, 24, 48, 24, 48, 8, 84, 24, 96, 48, 24, 0, 96, 6, 96, 48, 48, 36, 120, 24, 48, 24, 48, 48, 120, 24, 120, 0, 96, 24, 108, 30, 48, 72, 72, 32, 144, 0, 96, 72, 72, 48, 120, 0, 144, 12, 48, 48, 168, 48, 96
Offset: 0

Views

Author

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Cubic AGM theta functions: a(q) (see A004016), b(q) (A005928), c(q) (A005882).

Examples

			G.f. = 1 + 12*x + 6*x^2 + 24*x^3 + 12*x^4 + 24*x^5 + 8*x^6 + 48*x^7 + 6*x^8 + ...
G.f. = 1 + 12*q^2 + 6*q^4 + 24*q^6 + 12*q^8 + 24*q^10 + 8*q^12 + 48*q^14 + 6*q^16 + ...
From _Michael Somos_, Jan 05 2012: (Start)
a(2) = 6 since (1, -1, -1) is a solution to x^2 + y^2 + z^2 + x*y + x*z + y*z = 2 and the other 5 solutions are permutations and negations of this one.
a(2) = 6 since (1, 1, -1, -1) is a solution to x + y + z + w = 0 and x^2 + y^2 + z^2 + w^2 = 4 and the other 5 solutions are permutations of this one. (End)
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 113.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 263.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • N. J. A. Sloane and B. K. Teo, Theta series and magic numbers for close-packed spherical clusters, J. Chem. Phys. 83 (1985) 6520-6534.
  • L. V. Woodcock, Nature, Jan 09 1997, pp. 141-143.

Crossrefs

Cf. A004013, A005875, A005901, A045828. A055039 gives the positions of the 0's in this sequence.
Cf. A000007, A000122, A004016, A008444, A008445, A008446, A008447, A008448, A008449 (Theta series of lattices A_0, A_1, A_2, A_4, ...)

Programs

  • Magma
    L := Lattice("A",3); A := ThetaSeries(L, 140); A; /* Michael Somos, Nov 13 2014 */
    
  • Magma
    A := Basis( ModularForms( Gamma1(8), 3/2), 70); A[1] + 12*A[2] + 6*A[3] + 24*A[4]; /* Michael Somos, Sep 08 2018 */
    
  • Maple
    maxd := 201: temp0 := trunc(evalf(sqrt(maxd)))+2: a := 0: for i from -temp0 to temp0 do a := a+q^( (i+1/2)^2): od: th2 := series(a,q,maxd); a := 0: for i from -temp0 to temp0 do a := a+q^(i^2): od: th3 := series(a,q,maxd); th4 := series(subs(q=-q, th3),q,maxd); series((1/2)*(th3^3+th4^3),q,200);
  • Mathematica
    a[n_] := SquaresR[3, 2n]; Table[a[n], {n, 0, 69}] (* Jean-François Alcover, Jul 12 2012 *)
    a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q]^3 + EllipticTheta[ 4, 0, q]^3) / 2, {q, 0, 2 n}]; (* Michael Somos, May 24 2013 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q^2]^3 + 12 q QPochhammer[ q^4]^3 QPochhammer[ q^8]^2 / QPochhammer[ q^2]^2, {q, 0, n}]; (* Michael Somos, Nov 13 2014 *)
    SquaresR[3,2*Range[0,70]] (* Harvey P. Dale, Jun 01 2015 *)
  • PARI
    {a(n) = if( n<0, 0, n*=2; polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))}; /* Michael Somos, Oct 25 2006 */
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^4 + A)^5 / eta(x^2 + A)^2 / eta(x^8 + A)^2)^3 + 12 * x * eta(x^4 + A)^3 * eta(x^8 + A)^2 / eta(x^2 + A)^2, n))}; /* Michael Somos, May 17 2008 */
    
  • PARI
    {a(n) = if( n<1, n==0, 2 * qfrep( [2, 1, 1; 1, 2, 1; 1, 1, 2], n, 1)[n])}; /* Michael Somos, Jan 02 2012 */
    
  • Python
    from math import prod, isqrt
    from sympy import factorint
    def A004018(n): return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items())<<2 if n else 1
    def A004015(n): return A004018(m:=n<<1)+(sum(A004018(m-k**2) for k in range(1,isqrt(m)+1))<<1) # Chai Wah Wu, Feb 24 2025

Formula

Expansion of phi(q^2)^3 + 12 * q * phi(q^2) * psi(q^4)^2 in powers of q where phi(), psi() are Ramanujan theta functions. - Michael Somos, Oct 25 2006
Expansion of (phi(q)^3 + phi(-q)^3) / 2 in powers of q^2 where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006
Expansion of b(q) * phi(q^18) + c(q^3) * phi(q^2) in powers of q^3 where b(), c() are cubic AGM theta functions and phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006
Expansion of (theta_3(q)^3 + theta_4(q)^3) / 2 in powers of q^2.
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 2^(7/2) (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A004013.
a(n) = A005875(2*n).
G.f.: Sum_{i, j, k in Z} x^( i*i + j*j + k*k + i*j + i*k + j*k ). - Michael Somos, Jan 02 2012
From Michael Somos, Jan 05 2012: (Start)
Number of integer solutions to x^2 + y^2 + z^2 + x*y + x*z + y*z = n.
Number of integer solutions to x + y + z even and x^2 + y^2 + z^2 = 2 * n.
Number of integer solutions to x + y + z + w = 0 and x^2 + y^2 + z^2 + w^2 = 2 * n. (End)
a(2*n) = A005875(n). a(2*n+1) = 12 * A045828(n). - Michael Somos, Dec 28 2017

A094942 Numbers having a unique partition into three squares.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 19, 20, 21, 22, 24, 30, 32, 35, 37, 40, 42, 43, 44, 46, 48, 52, 56, 58, 64, 67, 70, 76, 78, 80, 84, 88, 91, 93, 96, 115, 120, 128, 133, 140, 142, 148, 160, 163, 168, 172, 176, 184, 190, 192, 208, 224, 232, 235
Offset: 1

Views

Author

T. D. Noe, May 24 2004

Keywords

Comments

Note that squares are allowed to be zero.
From Wolfdieter Lang, Apr 09 2013: (Start)
These are the numbers for which A000164(a(n)) = 1.
a(n) is the n-th largest number which has a representation as a sum of three squares (square 0 allowed), in exactly one way, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity with order and signs taken into account are A005875(a(n)).
These numbers are a proper subset of A000378.
(End)
Note that all these numbers are 4^k * A094739(n) for some k >= 0. - T. D. Noe, Nov 08 2013

Examples

			From _Wolfdieter Lang_, Apr 09 2013 (Start)
a(1) = 0 because 0 = 0^2 + 0^2 + 0^2 and 0 is the first number m with A000164(m)=1.
a(8) = 8 = 0^2 + 2^2 + 2^2, the 8th largest number m for which A000164(m) is 1.
(End)
		

Crossrefs

Cf. A025321 (numbers having a unique partition into three positive squares), A094739 (primitive n having a unique partition into three squares).
Cf. A000164, A005875, A000378, A224442 (two ways), A224443 (three ways).

Programs

  • Mathematica
    lim=25; nLst=Table[0, {lim^2}]; Do[n=a^2+b^2+c^2; If[n>0 && nRay Chandler, Oct 31 2019 *)

Formula

The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 1, m >= 0}.

Extensions

0 added by T. D. Noe, Apr 09 2013

A319574 A(n, k) = [x^k] JacobiTheta3(x)^n, square array read by descending antidiagonals, A(n, k) for n >= 0 and k >= 0.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 0, 4, 1, 0, 0, 4, 6, 1, 0, 2, 0, 12, 8, 1, 0, 0, 4, 8, 24, 10, 1, 0, 0, 8, 6, 32, 40, 12, 1, 0, 0, 0, 24, 24, 80, 60, 14, 1, 0, 0, 0, 24, 48, 90, 160, 84, 16, 1, 0, 2, 4, 0, 96, 112, 252, 280, 112, 18, 1, 0, 0, 4, 12, 64, 240, 312, 574, 448, 144, 20, 1
Offset: 0

Views

Author

Peter Luschny, Oct 01 2018

Keywords

Comments

Number of ways of writing k as a sum of n squares.

Examples

			[ 0] 1,  0,    0,    0,     0,     0,     0      0,     0,     0, ... A000007
[ 1] 1,  2,    0,    0,     2,     0,     0,     0,     0,     2, ... A000122
[ 2] 1,  4,    4,    0,     4,     8,     0,     0,     4,     4, ... A004018
[ 3] 1,  6,   12,    8,     6,    24,    24,     0,    12,    30, ... A005875
[ 4] 1,  8,   24,   32,    24,    48,    96,    64,    24,   104, ... A000118
[ 5] 1, 10,   40,   80,    90,   112,   240,   320,   200,   250, ... A000132
[ 6] 1, 12,   60,  160,   252,   312,   544,   960,  1020,   876, ... A000141
[ 7] 1, 14,   84,  280,   574,   840,  1288,  2368,  3444,  3542, ... A008451
[ 8] 1, 16,  112,  448,  1136,  2016,  3136,  5504,  9328, 12112, ... A000143
[ 9] 1, 18,  144,  672,  2034,  4320,  7392, 12672, 22608, 34802, ... A008452
[10] 1, 20,  180,  960,  3380,  8424, 16320, 28800, 52020, 88660, ... A000144
   A005843,   v, A130809,  v,  A319576,  v ,   ...      diagonal: A066535
           A046092,    A319575,       A319577,     ...
		

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 121.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954.
  • J. Carlos Moreno and Samuel S. Wagstaff Jr., Sums Of Squares Of Integers, Chapman & Hall/CRC, (2006).

Crossrefs

Variant starting with row 1 is A122141, transpose of A286815.

Programs

  • Maple
    A319574row := proc(n, len) series(JacobiTheta3(0, x)^n, x, len+1);
    [seq(coeff(%, x, j), j=0..len-1)] end:
    seq(print([n], A319574row(n, 10)), n=0..10);
    # Alternative, uses function PMatrix from A357368.
    PMatrix(10, n -> A000122(n-1)); # Peter Luschny, Oct 19 2022
  • Mathematica
    A[n_, k_] := If[n == k == 0, 1, SquaresR[n, k]];
    Table[A[n-k, k], {n, 0, 11}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Nov 03 2018 *)
  • Sage
    for n in (0..10):
        Q = DiagonalQuadraticForm(ZZ, [1]*n)
        print(Q.theta_series(10).list())

A063730 Number of solutions to w^2 + x^2 + y^2 + z^2 = n in positive integers.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 6, 0, 4, 4, 0, 12, 1, 0, 12, 4, 6, 4, 12, 12, 0, 12, 6, 12, 12, 0, 24, 16, 0, 12, 18, 12, 13, 16, 12, 28, 6, 0, 36, 16, 12, 24, 24, 24, 4, 16, 30, 24, 18, 12, 36, 36, 0, 28, 42, 12, 36, 16, 24, 52, 1, 24, 48, 28, 18, 24, 60, 36, 12
Offset: 0

Views

Author

N. J. A. Sloane, Aug 23 2001

Keywords

Crossrefs

Column k=4 of A337165.

Programs

  • Mathematica
    r[n_] := Reduce[ w > 0 && x > 0 && y > 0 && z > 0 && w^2 + x^2 + y^2 + z^2 == n, {w, x, y, z}, Integers]; a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === Or, Length[rn], True, 1]; Table[a[n], {n, 0, 72}] (* Jean-François Alcover, Jul 22 2013 *)
    a[n_ ] := Length[FindInstance[{n == w^2 + x^2 + y^2 + z^2, w > 0, x > 0, y > 0, z > 0}, {w, x, y, z}, Integers, 10^18]]; (* Michael Somos, Jun 23 2023 *)
  • PARI
    seq(n)=Vec((sum(k=1, sqrtint(n), x^(k^2)) + O(x*x^n))^4 + O(x*x^n), -(n+1)) \\ Andrew Howroyd, Aug 08 2018

Formula

G.f.: (Sum_{m>=1} x^(m^2))^4.
a(n) = ( A000118(n) - 4*A005875(n) + 6*A004018(n) - 4*A000122(n) + A000007(n) )/16. - Max Alekseyev, Sep 29 2012
G.f.: ((theta_3(q) - 1)/2)^4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018

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

Original entry on oeis.org

41, 50, 54, 65, 66, 74, 86, 90, 98, 99, 110, 113, 114, 117, 121, 122, 126, 131, 137, 145, 150, 164, 166, 169, 174, 178, 179, 181, 182, 186, 197, 200, 205, 216, 218, 219, 222, 226, 227, 229, 237, 258, 260, 264, 265, 275, 286, 291, 296, 302
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2013

Keywords

Comments

These are the numbers for which A000164(a(n)) = 3.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly three 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.

Examples

			a(1) = 41  = 0^2 + 4^2 + 5^2  = 1^2 + 2^2 + 6^2 = 3^3 + 4^2 + 4^2, and 41 is the first number m with A000164(m) = 3.
The representations [a,b,c] for n = 1, ..., 10, are:
n=1,  41: [0, 4, 5], [1, 2, 6], [3, 4, 4],
n=2,  50: [0, 1, 7], [0, 5, 5], [3, 4, 5],
n=3,  54: [1, 2, 7], [2, 5, 5], [3, 3, 6],
n=4,  65: [0, 1, 8], [0, 4, 7], [2, 5, 6],
n=5,  66: [1, 1, 8], [1, 4, 7], [4, 5, 5],
n=6,  74: [0, 5, 7], [1, 3, 8], [3, 4, 7],
n=7,  86: [1, 2, 9], [1, 6, 7], [5, 5, 6],
n=8,  90: [0, 3, 9], [1, 5, 8], [4, 5, 7],
n=9,  98: [0, 7, 7], [1, 4, 9], [3, 5, 8],
n=10, 99: [1, 7, 7], [3, 3, 9], [5, 5, 7].
		

Crossrefs

Cf. A000164, A005875, A000378, A094942 (one way), A224442 (two ways).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^23, 4, min(4, b(n, i-1, t)+
          `if`(i^2>n, 0, b(n-i^2, i, t-1))))))
        end:
    a:= proc(n) option remember; local k;
          for k from 1 +`if`(n=1, 0, a(n-1))
          while b(k, isqrt(k), 3)<>3 do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 09 2013
  • Mathematica
    Select[ Range[0, 400], Length[ PowersRepresentations[#, 3, 2]] == 3 &] (* Jean-François Alcover, Apr 09 2013 *)

Formula

This sequence gives the increasingly ordered numbers of the set {m integer | m = a^2 + b^2 + c^2, a, b and c integers with 0 <= a <= b <= c, and m has exactly three such representations}.
The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 3, m >= 0}.

A253663 Number of positive solutions to x^2+y^2+z^2 <= n^2.

Original entry on oeis.org

0, 0, 1, 7, 17, 38, 78, 127, 196, 296, 410, 564, 738, 958, 1220, 1514, 1848, 2235, 2686, 3175, 3719, 4365, 5007, 5758, 6568, 7442, 8415, 9477, 10597, 11779, 13100, 14459, 15954, 17566, 19231, 21029, 22916, 24930, 27030, 29293, 31616, 34103, 36732, 39459
Offset: 0

Views

Author

R. J. Mathar, Jan 07 2015

Keywords

Comments

Whereas A000604 counts solutions where x>=0, y>=0, z>=0, this sequence counts solutions where x>0, y>0, z>0.

Examples

			a(4)=17 counts the following solutions (x,y,z): (1,1,1), (2,2,2), three permutations of (1,1,2), three permutations of (1,1,3), three permutations of (1,2,2), and six permutations of (1,2,3).
		

Crossrefs

Cf. A000604.

Programs

  • Sage
    [len([(x,y,z) for x in [1..n] for y in [1..n] for z in [1..n] if x^2+y^2+z^2<=n^2]) for n in [0..43]] # Tom Edgar, Jan 07 2015

Formula

a(n) = A211639(n^2).
a(n) = [x^(n^2)] (theta_3(x) - 1)^3/(8*(1 - x)), where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Apr 17 2018
Comment from N. J. A. Sloane, Jun 02 2024 (Start)
The one-dimensional lattice {n: n an integer} , which graphically looks like
...o o o o o o ...
has theta series 1 + 2 q + 2 q^4 + 2 q^9 + 2 q^16 + ... = sum {n=-oo..oo} q^(n^2),
and that power series is called theta_3(q), A000122.
Raising it to the power 3 counts points with x^2+y^2+z^2 = k, A005875.
Dividing it by 1-x gives the partial sums, which basically is what this sequence is.
So a first approximation to a theta series for the sequence is theta_3(q)^8/(1-q).
Subtracting 1 and dividing by 8 is because here we only want positive solutions.
(End)
Previous Showing 11-20 of 84 results. Next