In 2155, Tobin Dax made note of how it was better to start a conversation off with a flashy trick than Andrew Wiles' proof of Fermat's theorem. (DS9 episode: "Facets", ENT novel: Beneath the Raptor's Wing)
In 2267, James T. Kirk cited Fermat’s theorem as an example of an insoluble problem when Janet Wallace stated that no problem was insoluble, even their relationship. (TOS novelization: The Deadly Years)
- Wiles proved the theorem nearly 30 years after production of The Deadly Years.
In 2371, Data mentioned a rumor that eight-year-old Adam Halliday wrote a new proof of the theorem at the Metadevelopmental Institute, which was confirmed by his father Robert Halliday. (TNG novel: Do Comets Dream?)
- TNG episode: "The Royale"
- DS9 episode: "Facets"
- TOS novelization: The Deadly Years
- ENT novel: Beneath the Raptor's Wing
- TNG novel: Do Comets Dream?
- NF novel: Gods Above