Ever had a puzzle that looked easy but tortured you incessantly until you found a solution? Would you work on it obsessively for seven years in isolation? Andrew Wiles did just that to prove Fermat’s Last Theorem.

Pierre de Fermat, a famous number theorist of the 17th century, rarely published his work – instead, he would often write comments in the margins of books. In one margin Fermat proposed that xn + yn = zn has no non-zero integer solutions for x, y and z when n > 2. However, rather than providing a proof, he only offered this taunting sentence: “I have discovered a truly remarkable proof which this margin is too small to contain.”

The proof for this simple conjecture was not solved for over 350 years and through the centuries became one of math’s greatest puzzles.

Fermat’s Last Theorem has entranced so many mathematicians due to its duality between simplicity and difficulty. It is easy to understand yet almost impossible to prove or disprove. That Fermat claimed to have a proof made it all the more intriguing. Mathematicians made some progress over the centuries in proving the correctness of the theorem for certain values of n – but this was hardly enough to prove that the theorem was correct for all values of n.

Then came along Andrew Wiles. As a child Wiles loved doing math problems. When he was ten he came across Fermat’s Last Theorem which was, at the time, unsolved for 300 years. “It looked so simple, and yet all the great mathematicians in history couldn’t solve it,” said Wiles. “I had to solve it.”

Wiles quickly became obsessed with solving the problem. Throughout his teenage and college years he worked on it, using his own methods and that of the mathematicians who had worked on it before him. However, when he became a research student he decided to put the problem aside. Wiles realized that current techniques could not solve the problem and that one could spend years without making any progress. Also, a proof of Fermat’s Last Theorem would be completely useless to mathematics – it would not lead to anything useful for mathematicians. Instead, he went on to study elliptical curves at Cambridge.

His study of elliptical curves would prove useful, for in 1986 a new possibility was presented to Wiles. Ken Ribet linked Fermat’s Last Theorem to another unsolved problem, the Taniyama-Shimura conjecture, which happened to be about elliptical curves. If one conjecture was true, both were – thus, if Wiles could prove the Taniyama-Shimura conjecture, he could prove Fermat’s Last Theorem as well.

From that moment on he was determined to solve the riddle. He dropped all other projects he was working on and concentrated on the Taniyama-Shimura conjecture – in secrecy and isolation. “I realized that anything to do with Fermat’s Last Theorem generates too much interest. You can’t really focus yourself for years unless you have undivided concentration, which too many spectators would have destroyed.” His wife did not even know that he was working on the problem until he told her during their honeymoon.

Wiles worked on the problem alone for seven years. He devoted all of his time to working on the proof, the only exception being spending time with his family. He had a few breakthroughs but not a complete proof until one day in spring of 1993 in which he had the idea of examining the elliptical curves from the prime five instead of the prime three. Working feverishly (and forgetting to eat lunch), Wiles went to his wife that afternoon saying he had the proof.

Wiles introduced the proof in a series of three lectures which made no mention of Fermat’s Last Theorem, but rather of elliptical curves. However, the audience realized by the end of the third lecture what Wiles was leading them towards. Once Wiles had finished his proof of the Taniyama-Shimura conjecture, he put Fermat’s Last Theorem on the board then concluded saying, “I think I’ll stop there.”

Wiles gained instant fame for having developed a solution to Fermat’s Last Theorem. However, soon Nick Katz discovered that there was an error in a key section of his original proof. This setback proved difficult for Wiles to overcome, and none of the methods he tried could solve the error. He was about to give up when he re-examined his original (though discarded) method and found that there was actually a way to use it to resolve his mistake. “It was so indescribably beautiful,” said Wiles about the moment he solved the problem. “It was so simple and so elegant, and I just stared in disbelief for twenty minutes.” Thus, in 1994 the final proof of Fermat’s Last Theorem was complete, weighing it at 200 pages, more complex than most people can understand.

The full riddle, however, is still not completely solved, for it remains unknown whether Fermat ever really had a brilliant proof to his conjecture. Fermat could not have thought of Wiles’ proof – Wiles says that, “the techniques used in this proof just weren’t around in Fermat’s time.” With the many mathematicians who had thought they’d solved it in the past, it is possible that Fermat deluded himself as well – but a simpler solution may still exist. Wiles, however, is content with his difficult proof – “I had this very rare privilege of being able to pursue in my adult life what had been my childhood dream.”