The Royale - S2-E12
Trivia: In this episode, Picard is studying Fermat's Great Theorem, and says it has remained unsolved for 800 years. Five years after the episode was made the theorem was proven, by Andrew Wiles and Richard Taylor from Princeton University (their proof is not the same as Fermat's though, as they used modern methods Fermat did not know of). In the Star Trek universe, this was referred to in an episode of Deep Space Nine, and is considered as a subtle correction for Picard's statements.