Jacobi's Four-Square Theorem — Definition, Formula & Example
Jacobi's Four-Square Theorem is a formula that tells you exactly how many ways a positive integer can be written as a sum of four squares of integers. Different orders and signs count as different ways, and zeros are allowed.
For a positive integer , let be the number of ordered quadruples with . Then . Equivalently, when is odd, and when is even, where is the largest odd divisor of and is the sum-of-divisors function.
Key Formula
Where:
- = Number of ordered, signed representations of n as a sum of four integer squares
- = The positive integer being represented
- = A positive divisor of n that is not a multiple of 4
Worked Example
Problem: Use Jacobi's Four-Square Theorem to find , the number of ways to write 4 as a sum of four integer squares. Then check the answer by listing the representations directly.
Step 1: List the positive divisors of 4. Drop any divisor that is a multiple of 4, then add the ones that remain.
Step 2: Multiply the sum by 8.
Step 3: Check by counting. The pattern has 4 positions for the 2 and 2 signs, giving 8 quadruples. The pattern has 2 sign choices in each of 4 slots, giving 16 quadruples. No other patterns work.
Answer: . The direct count of 8 + 16 quadruples agrees with the formula.
Why It Matters
Every positive integer has at least the divisor 1, which is not a multiple of 4. So , and Jacobi's formula therefore proves Lagrange's Four-Square Theorem: every positive integer is a sum of four squares. Jacobi proved it in the 1820s using theta functions. It is now a standard first application in courses on modular forms and analytic number theory.
Common Mistakes
Mistake: Adding every divisor of n, including multiples of 4. For this gives instead of .
Correction: Exclude divisors divisible by 4 before summing. You can also use the shortcut for even n: take 24 times the divisor sum of the odd part of n. For n = 4, that is 24 times 1, which equals 24.
