In additive number theory, the Fermat polygonal number theorem states that every positive integer is a sum of at most -gonal numbers. That is, every positive integer can be written as the sum of three or fewer triangular numbers, and as the sum of four or fewer square numbers, and as the sum of five or fewer pentagonal numbers, and so on. That is, the -gonal numbers form an additive basis of order . Examples Three such representations of the number 17, for example, are shown below: 17 = 10 + 6 + 1 (triangular numbers) 17 = 16 + 1 (square numbers) 17 = 12 + 5 (pentagonal numbers). History The theorem is named after Pierre de Fermat, who stated it, in 1638, without proof, promising to write it in a separate work that never appeared. Joseph Louis Lagrange proved the square case in 1770, which states that every positive number can be represented as a sum of four squares, for example, . Gauss proved the triangular case in 1796, commemorating the occasion by writing in his diary the line "ΕΥΡΗΚΑ! ", and published a proof in his book Disquisitiones Arithmeticae. For this reason, Gauss's result is sometimes known as the Eureka theorem. The full polygonal number theorem was not resolved until it was finally proven by Cauchy in 1813. The proof of is based on the following lemma due to Cauchy: For odd positive integers and such that and we can find nonnegative integers , , , and such that and . See also Pollock's conjectures Waring's problem Notes References . . . Has proofs of Lagrange's theorem and the polygonal number theorem. Additive number theory Analytic number theory Figurate numbers Theorems in number theory