# Fermat's Last Theorem in fiction

The famous problem in number theory known as "Fermat's Last Theorem" has repeatedly received attention in fiction and popular culture.

• In the Doctor Who episode "The Eleventh Hour", the Doctor transmits a proof of Fermat's Last Theorem by typing it in just a few seconds on Jeff's laptop to prove his genius to a collection of world leaders discussing the latest threat to the human race. This implies that the Doctor knew a proof which was quite short and easy for others to comprehend. The Doctor incorrectly says that Fermat was 'killed in a duel', the writers may have confused him with Evariste Galois.
• In The IT Crowd, Series 3 Episode 6 "Calendar Geeks", Fermat's Last Theorem is referenced during a photo shoot for a calendar about geeks and achievements in science and mathematics.
• In "The Royale", an episode (first aired 27 March 1989) of Star Trek: The Next Generation, Captain Picard states that the theorem had gone unsolved for 800 years. At the end of the episode Picard says, "Like Fermat's theorem, it is a puzzle we may never solve." Wiles' proof was released five years after the episode aired. This was subsequently mentioned in a Star Trek: Deep Space Nine episode called "Facets" during June 1995 in which Jadzia Dax comments that one of her previous hosts, Tobin Dax, had "the most original approach to the proof since Wiles over 300 years ago." This reference was generally understood by fans to be a retroactive continuity for "The Royale".
• A sum, proved impossible by the theorem, appears in an episode of The Simpsons, "Treehouse of Horror VI". In the three-dimensional world in "Homer3", the equation ${\displaystyle 1782^{12}+1841^{12}=1922^{12}}$ is visible, just as the dimension begins to collapse. The joke is that the twelfth root of the sum does evaluate to 1922 due to rounding errors when entered into most handheld calculators; notice that the left hand side is odd, while ${\displaystyle 1922^{12}}$ is even, so the equality cannot hold. Instead of 1922, it is approximately 1921.99999996. A second 'counterexample' appeared in a later episode, "The Wizard of Evergreen Terrace": ${\displaystyle 3987^{12}+4365^{12}=4472^{12}}$. These agree to 10 of 44 decimal digits, but notice that simple divisibility rules show 3987 and 4365 are multiples of 3 so that a sum of their powers is also. The same rule reveals that 4472 is not divisible by 3, so that this "equation" cannot hold either.
• In Tom Stoppard's play Arcadia, Septimus Hodge poses the problem of proving Fermat's Last Theorem to the precocious Thomasina Coverly (who is perhaps a mathematical prodigy), in an attempt to keep her busy. Thomasina's (perhaps perceptive) response is simple—that Fermat had no proof, and it was a joke to drive posterity mad.
• Arthur Porges' short story "The Devil and Simon Flagg" features a mathematician who bargains with the Devil that the latter cannot produce a proof of Fermat's Last Theorem within twenty-four hours. The devil is not successful and is last seen beginning a collaboration with the hero. The story was first published in 1954 in The Magazine of Fantasy and Science Fiction.
• Fermat's equation also appeared in the movie Bedazzled with Elizabeth Hurley and Brendan Fraser. Hurley played the devil who, in one of her many forms, appeared as a school teacher. In one particular scene, the blackboard behind her reads: "Tonight's homework: Prove ${\displaystyle a^{n}+b^{n}=c^{n}}$, solve for n>2".
• In Elizabeth Kay's book Jinx on the Divide, the main character intrigues a mythological griffin with the theorem; the griffin proves it in less than a week.
• In the online game the Lost Experience, which is directly related to the television series Lost, the theorem is said to have been originally proved by a scientist by the name of Enzo Vallenzetti sometime in the late 1960s, but that due to his eccentric nature, after having the proof verified by his colleagues, Vallenzetti is said to have burned his work so that, according to his assistant, "others could have as much fun solving it as he did".
• In chapter 7 of the visual novel Steins;Gate, Feiris asks Okabe if he is tense and he responds by saying he was calculating Fermat's Last Theorem in his head.
• In the book The Oxford Murders by Guillermo Martinez, Wiles's announcement in Cambridge of his proof of Fermat's Last Theorem forms a peripheral part of the action.
• In the anime series Earth Girl Arjuna directed and written by Shoji Kawamori, Mr. Sakurai, Juna's Math teacher in her school, passionately describes the breath-taking vastness and the empowering use of the equation and briefly explains the theory's history. Juna does not understand nor comprehend his explanation but feels that she heard his "true" voice.
• In the manga and anime series Zatch Bell!, Ponygon's question given to him by Unko Tin Tin is to prove Fermat's theorem, which Kiyo Takamine realizes is absurd. He asks Unko Tin Tin to prove it himself, which he cannot do.
• Arthur C. Clarke has used the theorem repeatedly:
• In the book The Light of Other Days, by Clarke and Stephen Baxter, technology was developed which allowed the general public to look back into time. A 12-year-old was able to read Fermat's actual proof and copy it to the present.
• In one of the Rama series books, the theorem is supposed to have been proved very simply and elegantly (probably the way Fermat himself had done it) by a young girl.
• Clarke, together with Frederik Pohl, later went on to write an entire novel, The Last Theorem, that tells of the rise to fame and world prominence of a young Sri Lankan mathematician who devises an elegant proof of the theorem.
• The rock metal band KINETO song "Theorem" describes Fermat's Last Theorem.
• In Jasper Fforde's book First Among Sequels, 9 year-old Tuesday Next, seeing the equation on the sixth-form's math classroom's chalkboard, and thinking it homework, finds a simple counterexample.
• In Stieg Larsson's 2006 book Flickan som lekte med elden (The Girl Who Played With Fire), the main character Lisbeth Salander is mesmerized by the Theorem. She spends a great deal of time trying to prove it herself, stubbornly avoiding the presented proof, eventually seeing through the riddle at a pivotal point in the action. Salander's final solution is different from that of Wiles, and the reader never discovers it. Salander claims that the solution was something implied by Fermat's declaration that the margin of the book that the Theorem was printed in was too small for the proof to be shown. The new solution that Salander discovered was later forgotten by her after she is shot in the head. This causes concern about her photographic memory as she has never before forgotten anything. However, she no longer craves an answer to the riddle.
• In Poul Anderson's book The Boat of a Million Years, the main character Hanno writes the statement of Fermat's Last Theorem on the graffiti covered wall of a restroom in a hospital, and below the statement he writes that he has a marvelous proof of this theorem, but there's not enough space on the wall to include it.
• In Robert Forward's 1984/1985 science fiction novel Rocheworld, Fermat's Last Theorem is unproved far enough into the future for interstellar explorers to describe it to one of the mathematically inclined natives of another star system. The native fairly quickly finds a proof.
• In The Melancholy of Haruhi Suzumiya, Kyon wonders if Itsuki Koizumi would be able to explain Fermat's Last Theorem.
• Fermat's Last Tango is a stage musical by Joanne Sydney Lessner and Joshua Rosenblum. Protagonist "Daniel Keane" is a fictionalized Andrew Wiles. The characters include Fermat, Pythagoras, Euclid, Newton, and Gauss, the singing, dancing mathematicians of "the aftermath". A DVD of the New York Theater Company production is available from the Clay Mathematics Institute.
• Fermat's Theorem is the story of Fermat's Last Theorem, told in comic book form by Alexandre Kha.
• In most of Don Lawrence's Storm, the (immortal) living planet Pandarve, in search for intellectual entertainment, is trying to come up with a proof for Fermat's Last Theorem. This keeps her mind so busy that she has little time for anything else, such as keeping an eye on the people who live on her surface, to whom she is a goddess. In need of her help to avoid a planetary catastrophe, Storm mentions Wiles' proof; when asked why he never spoke of it before, he says that he did not want to wake a sleeping goddess. To appease her wrath, however, he then tells Pandarve about Goldbach's conjecture.