Legendre's three-square theorem
A positive integer is a sum of three integer squares exactly when it is not of the form 4ᵃ(8b + 7), for nonnegative integers a and b.
A positive integer is a sum of three integer squares exactly when it is not of the form 4ᵃ(8b + 7), for nonnegative integers a and b.