The famous problem in number theory
known as "Fermat's Last Theorem
" has repeatedly received attention in fiction
and popular culture.
- In "The Royale", an episode of Star Trek: The Next Generation, Captain Picard states that the theorem had gone unsolved for 800 years. At the end of the episode Captain Picard says, "Like Fermat's theorem, it is a puzzle we may never solve." Wiles' proof was released five years after the particular 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 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 is even, so the equality cannot hold. The values agree to 9 of 40 decimal digits. A second 'counterexample' appeared in a later episode, "The Wizard of Evergreen Terrace": . These agree to 10 of 44 decimal digits, but notice simple divisibility rules show 3987 and 4365 are divisible by 9 so that a sum of their powers is also. A similar rule reveals 4472 is not divisible by 3, so that this 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. 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 this particular scene the blackboard behind her reads: "Tonight's homework: Prove ".
- In Elizabeth Kay's book Jinx on the Divide the main character intrigues a mythological griffin with the theorem; the griffin solves it in less than a week.
- In the online game the Lost Experience, which is directly related to the television series Lost, the equation is said to have been originally solved by a scientist by the name of Enzo Vallenzetti sometime in the late 1960s. However 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 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.
- 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 present it in the present time.
- In one of the Rama series books the problem is supposed to have been solved very simply and elegantly (probably the way Fermat himself had intended it) by a young girl.
- Clarke, together with Frederick Pohl, later went on to write an entire novel, The Last Theorem, based on the theorem.
- The rock metal band KINETO has a song entitled "Theorem" that 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 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.
- 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 write it.
- In Robert Forward's 1984/1985 science fiction novel Rocheworld, Fermat's Last Theorem is unsolved 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 solution.