In number theory, the sum of squares function is an arithmetic function that gives the number of representations for a given positive integern as the sum of ksquares, where representations that differ only in the order of the summands or in the signs of the numbers being squared are counted as different. It is denoted by rk(n).
where denotes the cardinality of a set. In other words, rk(n) is the number of ways n can be written as a sum of k squares.
For example, since where each sum has two sign combinations, and also since with four sign combinations. On the other hand, because there is no way to represent 3 as a sum of two squares.
Formulae
k = 2
The number of ways to write a natural number as sum of two squares is given by r2(n). It is given explicitly by
where d1(n) is the number of divisors of n which are congruent to 1 modulo 4 and d3(n) is the number of divisors of n which are congruent to 3 modulo 4. Using sums, the expression can be written as:
The prime factorization, where are the prime factors of the form and are the prime factors of the form gives another formula
, if all exponents are even. If one or more are odd, then .
where h(m) denotes the class number of an integer m.
There exist extensions of Gauss' formula to arbitrary integer n.[1][2]
k = 4
The number of ways to represent n as the sum of four squares was due to Carl Gustav Jakob Jacobi and it is eight times the sum of all its divisors which are not divisible by 4, i.e.
Representing n = 2km, where m is an odd integer, one can express in terms of the divisor function as follows:
k = 6
The number of ways to represent n as the sum of six squares is given by
^P. T. Bateman (1951). "On the Representation of a Number as the Sum of Three Squares" (PDF). Trans. Amer. Math. Soc. 71: 70–101. doi:10.1090/S0002-9947-1951-0042438-4.
^S. Bhargava; Chandrashekar Adiga; D. D. Somashekara (1993). "Three-Square Theorem as an Application of Andrews' Identity" (PDF). Fibonacci Quart. 31 (2): 129–133.
^ a bCohen, H. (2007). "5.4 Consequences of the Hasse–Minkowski Theorem". Number Theory Volume I: Tools and Diophantine Equations. Springer. ISBN 978-0-387-49922-2.
^Milne, Stephen C. (2002). "Introduction". Infinite Families of Exact Sums of Squares Formulas, Jacobi Elliptic Functions, Continued Fractions, and Schur Functions. Springer Science & Business Media. p. 9. ISBN 1402004915.
Further Reading
Grosswald, Emil (1985). Representations of integers as sums of squares. Springer-Verlag. ISBN 0387961267.