The number of representations of by squares is denoted . The *Mathematica*
(Wolfram Research,
Champaign, IL) function `NumberTheory`NumberTheoryFunctions`SumOfSquaresR[k,n]` gives .

is often simply written . Jacobi solved the problem for , 4, 6, and 8. The first cases , 4, and 6 were found by equating Coefficients of the Theta Function , , and . The solutions for and 12 were found by Liouville and Eisenstein, and Glaisher (1907) gives a table of for . was found as a finite sum involving quadratic reciprocity symbols by Dirichlet. and were found by Eisenstein, Smith, and Minkowski.

is 0 whenever has a Prime divisor of the form to an Odd Power; it doubles upon
reaching a new Prime of the form . It is given explicitly by

(1) |

(2) |

(3) |

Asymptotic results include

(4) | |||

(5) |

where is a constant known as the Sierpinski Constant. The left plot above shows

(6) |

(7) |

The number of solutions of

(8) |

(9) |

Additional higher-order identities are given by

(10) | |||

(11) | |||

(12) | |||

(13) |

where

(14) | |||

(15) | |||

(16) |

, is the number of divisors of of the form , is a Singular Series, is the Divisor Function, is the Divisor Function of order 0 (i.e., the number of Divisors), and is the Tau Function.

Similar expressions exist for larger Even , but they quickly become extremely complicated and can be written simply only in terms of expansions of modular functions.

**References**

Arno, S. ``The Imaginary Quadratic Fields of Class Number 4.'' *Acta Arith.* **60**, 321-334, 1992.

Boulyguine. *Comptes Rendus Paris* **161**, 28-30, 1915.

New York: Chelsea, p. 317, 1952.

Glaisher, J. W. L. ``On the Numbers of a Representation of a Number as a Sum of Squares, where Does Not Exceed 18.''
*Proc. London Math. Soc.* **5**, 479-490, 1907.

Grosswald, E. *Representations of Integers as Sums of Squares.* New York: Springer-Verlag, 1985.

Hardy, G. H. ``The Representation of Numbers as Sums of Squares.'' Ch. 9 in
*Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work, 3rd ed.* New York: Chelsea, 1959.

Hardy, G. H. and Wright, E. M. ``The Function ,'' ``Proof of the Formula for ,'' ``The Generating Function of ,''
and ``The Order of .'' §16.9, 16.10, 17.9, and 18.7 in *An Introduction to the Theory of Numbers, 5th ed.*
Oxford, England: Clarendon Press, pp. 241-243, 256-258, and 270-271, 1979.

Shanks, D. *Solved and Unsolved Problems in Number Theory, 4th ed.* New York: Chelsea, pp. 162-153, 1993.

Sloane, N. J. A. Sequences
A014198 and
A004018/M3218
in ``An On-Line Version of the Encyclopedia of Integer Sequences.''
http://www.research.att.com/~njas/sequences/eisonline.html and Sloane, N. J. A. and Plouffe, S.
*The Encyclopedia of Integer Sequences.* San Diego: Academic Press, 1995.

© 1996-9

1999-05-25