The Sum-of-Squares Function and Jacobi's Two-Square Theorem

Manuel Eberl 📧

November 26, 2024

This is a development version of this entry. It might change over time and is not stable. Please refer to release versions for citations.

Abstract

This entry defines the sum-of-squares function rk(n), which counts the number of ways to write a natural number n as a sum of k squares of integers. Signs and permutations of these integers are taken into account, such that e.g. 12+22, 22+12, and (−1)2+22 are all different decompositions of 5.

Using this, I then formalise the main result: Jacobi's two-square theorem, which states that for n>0 we have r2(n)=4(d1(3)−d3(n)) , where di(n) denotes the number of divisors m of n such that m=i (mod 4).

Corollaries include the identities r2(2n)=r2(n) and r2(p2n)=r2(n) if p=3 (mod 4) and the well-known theorem that r2(n)=0 iff n has a prime factor p of odd multiplicity with p=3 (mod 4).

License

BSD License

Topics

Session Sum_Of_Squares_Count