**Lagrange's Four-Square Theorem**, also known as Bachet's Conjecture, was proved in 1770 by Joseph Louis Lagrange.

It states that every positive integer can be expressed as the sum of at most four squares.

More formally, for every positive integer n there exist non-negative integers a,b,c,d such that *n* = *a*^{2} + *b*^{2} + *c*^{2} + *d*^{2}

Adrien-Marie Legendre improved on the theorem in 1798 by stating that a positive integer can be expressed as the sum of at most three squares if and only if it is not of the form (4^{k})(8*l*-7). His proof was incomplete, leaving a gap which was later filled by Karl Friedrich Gauss.