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

A005875 Theta series of simple cubic lattice; also number of ways of writing a nonnegative integer n as a sum of 3 squares (zero being allowed).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of ordered triples (i, j, k) of integers such that n = i^2 + j^2 + k^2.
The Madelung Coulomb energy for alternating unit charges in the simple cubic lattice is Sum_{n>=1} (-1)^n*a(n)/sqrt(n) = -A085469. - R. J. Mathar, Apr 29 2006
a(A004215(k))=0 for k=1,2,3,... but no other elements of {a(n)} are zero. - Graeme McRae, Jan 15 2007

Examples

			Order and signs are taken into account: a(1) = 6 from 1 = (+-1)^2 + 0^2 + 0^2, a(2) = 12 from 2 = (+-1)^2 + (+-1)^2 + 0^2; a(3) = 8 from 3 = (+-1)^2 + (+-1)^2 + (+-1)^2, etc.
G.f. =  1 + 6*q + 12*q^2 + 8*q^3 + 6*q^4 + 24*q^5 + 24*q^6 + 12*q^8 + 30*q^9 + 24*q^10 + ...
		

References

  • H. Cohen, Number Theory, Vol. 1: Tools and Diophantine Equations, Springer-Verlag, 2007, p. 317.
  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • H. Davenport, The Higher Arithmetic. Cambridge Univ. Press, 7th ed., 1999, Chapter V.
  • 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. 3, p. 109.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 54.
  • L. Kronecker, Crelle, Vol. LVII (1860), p. 248; Werke, Vol. IV, p. 188.
  • C. J. Moreno and S. S. Wagstaff, Jr., Sums of Squares of Integers, Chapman and Hall, 2006, p. 43.
  • T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.
  • W. Sierpiński, 1925. Teorja Liczb. pp. 1-410 (p.61).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • H. J. S. Smith, Report on the Theory of Numbers, reprinted in Vol. 1 of his Collected Math. Papers, Chelsea, NY, 1979, see p. 338, Eq. (B').

Crossrefs

Row d=3 of A122141 and of A319574, 3rd column of A286815.
Cf. A074590 (primitive solutions), A117609 (partial sums), A004215 (positions of zeros).
Analog for 4 squares: A000118.
x^2+y^2+k*z^2: A005875, A014455, A034933, A169783, A169784.
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Programs

  • Julia
    # JacobiTheta3 is defined in A000122.
    A005875List(len) = JacobiTheta3(len, 3)
    A005875List(75) |> println # Peter Luschny, Mar 12 2018
    
  • Magma
    Basis( ModularForms( Gamma1(4), 3/2), 75) [1]; /* Michael Somos, Jun 25 2014 */
    
  • Maple
    (sum(x^(m^2),m=-10..10))^3; seq(coeff(%,x,n), n=0..50);
    Alternative:
    A005875list := proc(len) series(JacobiTheta3(0, x)^3, x, len+1);
    seq(coeff(%, x, j), j=0..len-1) end: A005875list(75); # Peter Luschny, Oct 02 2018
  • Mathematica
    SquaresR[3,Range[0,80]] (* Harvey P. Dale, Jul 21 2011 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q]^3, {q, 0, n}]; (* Michael Somos, Jun 25 2014 *)
    a[ n_] := Length @ FindInstance[ n == x^2 + y^2 + z^2, {x, y, z}, Integers, 10^9]; (* Michael Somos, May 21 2015 *)
    QP = QPochhammer; CoefficientList[(QP[q^2]^5/(QP[q]*QP[q^4])^2)^3 + O[q]^80, q] (* Jean-François Alcover, Nov 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))};
    
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^2 + A)^5 / (eta(x + A) * eta(x^4 + A))^2)^3, n))}; /* Michael Somos, Jun 03 2012 */
    
  • PARI
    {a(n) = my(G); if( n<0, 0, G = [ 1, 0, 0; 0, 1, 0; 0, 0, 1]; polcoeff( 1 + 2 * x * Ser( qfrep( G, n)), n))}; /* Michael Somos, May 21 2015 */
    
  • Python
    # uses Python code for A004018
    from math import isqrt
    def A005875(n): return A004018(n)+(sum(A004018(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 21 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*3)
    Q.representation_number_list(75) # Peter Luschny, Jun 20 2014
    

Formula

A number n is representable as the sum of 3 squares iff n is not of the form 4^a (8k+7) (cf. A000378).
There is a classical formula (essentially due to Gauss):
For sums of 3 squares r_3(n): write (uniquely) -n=D(2^vf)^2, with D<0 fundamental discriminant, f odd, v>=-1. Then r_3(n) = 12L((D/.),0)(1-(D/2)) Sum_{d | f} mu(d)(D/d)sigma(f/d).
Here mu is the Moebius function, (D/2) and (D/d) are Kronecker-Legendre symbols, sigma is the sum of divisors function, L((D/.),0)=h(D)/(w(D)/2) is the value at 0 of the L function of the quadratic character (D/.), equal to the class number h(D) divided by 2 or 3 in the special cases D=-4 and -3. - Henri Cohen (Henri.Cohen(AT)math.u-bordeaux1.fr), May 12 2010
a(n) = 3*T(n) if n == 1,2,5,6 mod 8, = 2*T(n) if n == 3 mod 8, = 0 if n == 7 mod 8 and = a(n/4) if n == 0 mod 4, where T(n) = A117726(n). [Moreno-Wagstaff].
"If 12E(n) is the number of representations of n as a sum of three squares, then E(n) = 2F(n) - G(n) where G(n) = number of classes of determinant -n, F(n) = number of uneven classes." - Dickson, quoting Kronecker. [Cf. A117726.]
a(n) = Sum_{d^2|n} b(n/d^2), where b() = A074590() gives the number of primitive solutions.
Expansion of phi(q)^3 in powers of q where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006.
Euler transform of period 4 sequence [ 6, -9, 6, -3, ...]. - Michael Somos, Oct 25 2006
G.f.: (Sum_{k in Z} x^(k^2))^3.
a(8*n + 7) = 0. a(4*n) = a(n).
a(n) = A004015(2*n) = A014455(2*n) = A004013(4*n) = A169783(4*n). a(4*n + 1) = 6 * A045834(n). a(8*n + 3) = 8 * A008443(n). a(8*n + 5) = 24 * A045831(n). - Michael Somos, Jun 03 2012
a(4*n + 2) = 12 * A045828(n). - Michael Somos, Sep 03 2014
a(n) = (-1)^n * A213384(n). - Michael Somos, May 21 2015
a(n) = (6/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = A004018(n) + 2*Sum_{k=1..floor(sqrt(n))} A004018(n - k^2). - Daniel Suteu, Aug 27 2021
Convolution cube of A000122. Convolution of A004018 and A000122. - R. J. Mathar, Aug 03 2025

Extensions

More terms from James Sellers, Aug 22 2000

A000161 Number of partitions of n into 2 squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of ways of writing n as a sum of 2 (possibly zero) squares when order does not matter.
Number of similar sublattices of square lattice with index n.
Let Pk = the number of partitions of n into k nonzero squares. Then we have A000161 = P0 + P1 + P2, A002635 = P0 + P1 + P2 + P3 + P4, A010052 = P1, A025426 = P2, A025427 = P3, A025428 = P4. - Charles R Greathouse IV, Mar 08 2010, amended by M. F. Hasler, Jan 25 2013
a(A022544(n))=0; a(A001481(n))>0; a(A125022(n))=1; a(A118882(n))>1. - Reinhard Zumkeller, Aug 16 2011

Examples

			25 = 3^2+4^2 = 5^2, so a(25) = 2.
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 339

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000164 (3), A002635 (4), A000174 (5).

Programs

  • Haskell
    a000161 n =
       sum $ map (a010052 . (n -)) $ takeWhile (<= n `div` 2) a000290_list
    a000161_list = map a000161 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    A000161 := proc(n) local i,j,ans; ans := 0; for i from 0 to n do for j from i to n do if i^2+j^2=n then ans := ans+1 fi od od; RETURN(ans); end; [ seq(A000161(i), i=0..50) ];
    A000161 := n -> nops( numtheory[sum2sqr](n) ); # M. F. Hasler, Nov 23 2007
  • Mathematica
    Length[PowersRepresentations[ #,2,2]] &/@Range[0,150] (* Ant King, Oct 05 2010 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1))) \\ for illustrative purpose
    
  • PARI
    A000161(n)=sum(k=sqrtint((n-1)\2)+1,sqrtint(n),issquare(n-k^2)) \\ Charles R Greathouse IV, Mar 21 2014, improves earlier code by M. F. Hasler, Nov 23 2007
    
  • PARI
    A000161(n)=#sum2sqr(n) \\ See A133388 for sum2sqr(). - M. F. Hasler, May 13 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A000161(n):
        f = factorint(n)
        return int(not any(e&1 for e in f.values())) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 1 # Chai Wah Wu, Sep 08 2022

Formula

a(n) = card { { a,b } c N | a^2+b^2 = n }. - M. F. Hasler, Nov 23 2007
Let f(n)= the number of divisors of n that are congruent to 1 modulo 4 minus the number of its divisors that are congruent to 3 modulo 4, and define delta(n) to be 1 if n is a perfect square and 0 otherwise. Then a(n)=1/2 (f(n)+delta(n)+delta(1/2 n)). - Ant King, Oct 05 2010

A000378 Sums of three squares: numbers of the form x^2 + y^2 + z^2.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition: numbers of the form x^2 + y^2 + z^2 with x,y,z >= 0.
Bourgain studies "the spatial distribution of the representation of a large integer as a sum of three squares, on the small and critical scale as well as their electrostatic energy. The main results announced give strong evidence to the thesis that the solutions behave randomly. This is in sharp contrast to what happens with sums of two or four or more square." Sums of two nonzero squares are A000404. - Jonathan Vos Post, Apr 03 2012
The multiplicities for a(n) (if 0 <= x <= y <= z) are given as A000164(a(n)), n >= 1. Compare with A005875(a(n)) for integer x, y and z, and order taken into account. - Wolfdieter Lang, Apr 08 2013
a(n)^k is a member of this sequence for any k > 1. - Boris Putievskiy, May 05 2013
The selection rule for the planes with Miller indices (hkl) to undergo X-ray diffraction in a simple cubic lattice is h^2+k^2+l^2 = N where N is a term of this sequence. See A004014 for f.c.c. lattice. - Mohammed Yaseen, Nov 06 2022

Examples

			a(1) = 0 = 0^2 + 0^2 + 0^2. A005875(0) = 1 = A000164(0).
a(9) = 9 = 0^2 + 0^2 + 3^2 =  1^2 +  2^2 + 2^2. A000164(9) = 2. A000164(9) = 30 = 2*3 + 8*3 (counting signs and order). - _Wolfdieter Lang_, Apr 08 2013
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 107.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 37.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section C20.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 311.

Crossrefs

Union of A000290, A000404 and A000408 (common elements).
Union of A000290, A000415 and A000419 (disjunct sets).
Complement of A004215.
Cf. A005875 (number of representations if x, y and z are integers).

Programs

  • Maple
    isA000378 := proc(n) # return true or false depending on n being in the list
        local x,y ;
        for x from 0 do
            if 3*x^2 > n then
                return false;
            end if;
            for y from x do
                if x^2+2*y^2 > n then
                    break;
                else
                    if issqr(n-x^2-y^2) then
                        return true;
                    end if;
                end if;
            end do:
        end do:
    end proc:
    A000378 := proc(n) # generate A000378(n)
        option remember;
        local a;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA000378(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A000378(n),n=1..100) ; # R. J. Mathar, Sep 09 2015
  • Mathematica
    okQ[n_] := If[EvenQ[k = IntegerExponent[n, 2]], m = n/2^k; Mod[m, 8] != 7, True]; Select[Range[0, 100], okQ] (* Jean-François Alcover, Feb 08 2016, adapted from PARI *)
  • PARI
    isA000378(n)=my(k=valuation(n, 2)); if(k%2==0, n>>=k; n%8!=7, 1)
    
  • PARI
    list(lim)=my(v=List(),k,t); for(x=0,sqrtint(lim\=1), for(y=0, min(sqrtint(lim-x^2),x), k=x^2+y^2; for(z=0,min(sqrtint(lim-k), y), listput(v,k+z^2)))); Set(v) \\ Charles R Greathouse IV, Sep 14 2015
    
  • Python
    def valuation(n, b):
        v = 0
        while n > 1 and n%b == 0: n //= b; v += 1
        return v
    def ok(n): return n//4**valuation(n, 4)%8 != 7
    print(list(filter(ok, range(84)))) # Michael S. Branicky, Jul 15 2021
    
  • Python
    from itertools import count, islice
    def A000378_gen(): # generator of terms
        return filter(lambda n:n>>2*(bin(n)[:1:-1].index('1')//2) & 7 < 7, count(1))
    A000378_list = list(islice(A000378_gen(),30)) # Chai Wah Wu, Jun 27 2022
    
  • Python
    def A000378(n):
        def f(x): return n-1+sum(((x>>(i<<1))-7>>3)+1 for i in range(x.bit_length()>>1))
        m, k = n-1, f(n-1)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 14 2025

Formula

Legendre: a nonnegative integer is a sum of three squares iff it is not of the form 4^k m with m == 7 (mod 8).
n^(2k+1) is in the sequence iff n is in the sequence. - Ray Chandler, Feb 03 2009
Complement of A004215; complement of A000302(i)*A004771(j), i,j>=0. - Boris Putievskiy, May 05 2013
a(n) = 6n/5 + O(log n). - Charles R Greathouse IV, Mar 14 2014

Extensions

More terms from Ray Chandler, Sep 05 2004

A002635 Number of partitions of n into 4 squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A124978(n)) = n; a(A006431(n)) = 1; a(A180149(n)) = 2; a(A245022(n)) = 3. - Reinhard Zumkeller, Jul 13 2014

Examples

			1: 1000; 2: 1100; 3:1110; 4: 2000 and 1111; 5: 2100; 6: 2110; 7: 2111; 8: 2200; 9: 3000 and 2210; 10: 3100 and 2211; etc.
		

References

  • G. Loria, Sulla scomposizione di un intero nella somma di numeri poligonali. (Italian) Atti Accad. Naz. Lincei. Rend. Cl. Sci. Fis. Mat. Nat. (8) 1, (1946). 7-15.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000161 (2), A000164 (3), A000174 (5), A000177 (6), A025422 (7), A025423 (8), A025424 (9), A025425 (10).

Programs

  • Haskell
    a002635 = p (tail a000290_list) 4 where
    p ks'@(k:ks) c m = if m == 0 then 1 else
    if c == 0 || m < k then 0 else p ks' (c - 1) (m - k) + p ks c m
    -- Reinhard Zumkeller, Jul 13 2014
  • Mathematica
    Length[PowersRepresentations[ #, 4, 2]] & /@ Range[0, 107] (* Ant King, Oct 19 2010 *)
  • PARI
    for(n=1,100,print1(sum(a=0,n,sum(b=0,a,sum(c=0,b,sum(d=0,c,if(a^2+b^2+c^2+d^2-n,0,1))))),","))
    
  • PARI
    a(n)=local(c=0); if(n>=0, forvec(x=vector(4,k,[0,sqrtint(n)]),c+=norml2(x)==n,1)); c
    

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

A000174 Number of partitions of n into 5 squares.

Original entry on oeis.org

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

Views

Author

Keywords

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 84.

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000161 (2), A000164 (3), A002635 (4), A000177 (6), A025422 (7), A025423 (8), A025424 (9), A025425 (10).
Cf. A025429, A295160 (largest number k with a(k) = n).

Programs

  • Mathematica
    Table[PowersRepresentations[n, 5, 2] // Length, {n, 0, 100}] (* Jean-François Alcover, Feb 04 2016 *)

A016727 Number of inequivalent solutions to x^2+y^2+z^2 = n^2.

Original entry on oeis.org

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

Views

Author

csvcjld(AT)nomvst.lsumc.edu

Keywords

Crossrefs

Cf. A065458.
Column k=3 of A255212.

Programs

  • Mathematica
    Table[Length[PowersRepresentations[n^2, 3, 2]], {n, 0, 100}]

Formula

a(n) = A000164(n^2). - R. J. Mathar, Feb 12 2017

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}.

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

Original entry on oeis.org

9, 17, 18, 25, 26, 27, 29, 33, 34, 36, 38, 45, 49, 51, 53, 57, 59, 61, 62, 68, 69, 72, 73, 75, 77, 82, 83, 85, 94, 97, 100, 102, 104, 105, 106, 107, 108, 109, 116, 118, 123, 130, 132, 136, 138, 139, 141, 144, 147, 152, 154, 155, 157, 158, 165, 177, 180, 187
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2013

Keywords

Comments

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

Examples

			a(1) = 9 = 0^2 + 0^2 + 3^2 = 1^2 + 2^2 + 2^2, and 9 is the smallest number m with A000164(m) = 2 for m >= 0. The multiplicity with order and signs taken into account is 2*3 + 8*3 = 30 = A005875(9).
The two representations [a,b,c] for a(n), n = 1, ..., 10, are
n=1,   9 = [0, 0, 3], [1, 2, 2],
n=2,  17 = [0, 1, 4], [2, 2, 3],
n=3,  18 = [0, 3, 3], [1, 1, 4],
n=4,  25 = [0, 0, 5], [0, 3, 4],
n=5,  26 = [0, 1, 5], [1, 3, 4],
n=6,  27 = [1, 1, 5], [3, 3, 3],
n=7,  29 = [0, 2, 5], [2, 3, 4],
n=8,  33 = [1, 4, 4], [2, 2, 5],
n=9,  34 = [0, 3, 5], [3, 3, 4],
n=10, 36 = [0, 0, 6], [2, 4, 4].
		

Crossrefs

Cf. A000164, A005875, A000378, A094942 (one way), A224443 (three ways).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^22, 3, min(3, 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)<>2 do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 09 2013
  • Mathematica
    Select[ Range[0, 200], Length[ PowersRepresentations[#, 3, 2]] == 2 &] (* Jean-François Alcover, Apr 09 2013 *)

Formula

This sequence gives the increasingly ordered elements 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 two such representation}.
The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 2, m >= 0}.

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

Original entry on oeis.org

81, 89, 101, 125, 129, 134, 149, 161, 162, 170, 171, 173, 189, 198, 201, 233, 241, 242, 243, 245, 246, 249, 250, 251, 254, 270, 274, 278, 285, 289, 294, 299, 324, 339, 349, 356, 361, 363, 370, 371, 378, 387, 390, 393, 395, 404, 406, 411, 417, 429, 433, 451
Offset: 1

Views

Author

Robert Price, Nov 02 2017

Keywords

Comments

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

Extensions

Updated Mathematica program to Version 11. by Robert Price, Nov 01 2019
Showing 1-10 of 27 results. Next