In number theory, Fermat’s Last Theorem (sometimes called Fermat’s conjecture, especially in older texts) states that no three positive integers a, b, and c can satisfy the equation an + bn = cn for any integer value of n greater than two.

This theorem was first conjectured by Pierre de Fermat in 1637, famously in the margin of a copy of Arithmetica where he claimed he had a proof that was too large to fit in the margin. No successful proof was published until 1995 despite the efforts of countless mathematicians during the 358 intervening years. The unsolved problem stimulated the development of algebraic number theory in the 19th century and the proof of the modularity theorem in the 20th century. It is among the most famous theorems in the history of mathematics and prior to its 1995 proof was in the Guinness Book of World Records for “most difficult mathematical problems”.

**The Problem**

Fermat’s Last Theorem (known by this title historically although technically a conjecture, or unproven speculation, until proven in 1995) stood as an unsolved riddle in mathematics for over three centuries. The Theorem itself is a deceptively simple statement within mathematics that Fermat famously stated he had solved around 1637. His claim was discovered some 30 years later, after his death, as a bare statement in the margin of a book, but Fermat died without leaving any proof of his claim.

The claim eventually became one of the most famous unsolved problems of mathematics. The attempts made to prove it during that time prompted substantial development of number theory and over time Fermat’s Last Theorem itself gained legendary prominence as an unsolved problem in popular mathematics. It is based upon the well known formula (“Pythagoras’ Theorem”) for a right-angle triangle discovered by the ancient Greek mathematician Pythagoras: a2 + b2 = c2.

The Pythagorean equation has an infinite number of whole-number solutions, representing the sides of a right-angle triangle; these solutions are known as Pythagorean triples. Fermat conjectured that the more general equation an + bn = cn had no solutions in positive integers a, b and c for any integer exponent greater than 2 — in other words that although a2 + b2 = c2 had an infinite number of whole-number solutions, the similar equations

a3 + b3 = c3

a4 + b4 = c4

an + bn = cn

for any other integer exponent n greater than 2 would have no solutions in positive integers. Although he claimed to have a general proof of his conjecture, Fermat left no details of his proof apart from the special case n = 4.

**Subsequent developments and solution**

With the special case n = 4 proven, the problem was to prove the theorem for exponents n that are prime numbers (this limitation is considered trivial to prove[note 1]). Over the next two centuries (1637–1839), the conjecture was proven for only the primes 3, 5, and 7, although Sophie Germain innovated and proved an approach which was relevant to an entire class of primes. In the mid-19th century, Ernst Kummer extended this and proved the theorem for all regular primes, leaving irregular primes to be analyzed individually. Building on Kummer’s work and using sophisticated computer studies, other mathematicians were able to extend the proof to cover all prime exponents up to four million, but a proof for all exponents was inaccessible (meaning that mathematicians generally considered a proof to be either impossible, or at best exceedingly difficult, or not achievable with current knowledge).

The proof of Fermat’s Last Theorem in full, for all n, was finally accomplished, however, after 358 years, by Andrew Wiles in 1995, an achievement for which he was honoured and received numerous awards. The solution came in a roundabout manner, from a completely different area of mathematics.

Around 1955 Japanese mathematicians Goro Shimura and Yutaka Taniyama suspected a link might exist between elliptic curves and modular forms, two completely different areas of mathematics. Known at the time as the Taniyama–Shimura-Weil conjecture, and (eventually) as the modularity theorem, it stood on its own, with no apparent connection to Fermat’s Last Theorem. It was widely seen as significant and important in its own right, but was (like Fermat’s equation) widely considered to be completely inaccessible to proof.

In 1984, Gerhard Frey noticed an apparent link between the modularity theorem and Fermat’s Last Theorem. This potential link was confirmed two years later by Ken Ribet (see: Ribet’s Theorem and Frey curve). On hearing this, English mathematician Andrew Wiles, who had a childhood fascination with Fermat’s Last Theorem, decided to try and prove the modularity theorem as a way to prove Fermat’s Last Theorem. In 1993, after six years working secretly on the problem, Wiles succeeded in proving enough of the modularity theorem to prove Fermat’s Last Theorem. Wiles paper was massive in size and scope. A flaw was discovered in one part of his original paper during peer review and required a further year and collaboration with a past student, Richard Taylor, to resolve. As a result, the final proof in 1995 was accompanied by a second, smaller, joint paper to that effect. Wiles’s achievement was reported widely in the popular press, and was popularized in books and television programs. The remaining parts of the modularity theorem were subsequently proven by other mathematicians, building on Wiles’ work, between 1996 and 2001.