In number theory, Jacobi's four-square theorem gives a formula for the number of ways that a given positive integer n can be represented as the sum of four squares (of integers).