Jeyl wrote:
PICARD: Like Fermat's theorem, it's a puzzle we may never solve.

Andrew Wiles on Solving Fermat
Yeah. Humanity will develop technology that will enable us to travel hundreds of times faster than the speed of light and transporter technology that literally sends us from one place to another without moving, and yet we won't be able to figure out Fermat's theorem.... which we already have in real life.

In fairness, Wiles published his proof in 1995, and when this episode came out in 1989 nobody knew he was even working in it.
Timo wrote:
As for Fermat's theorem, Fermat's own solution to it has certainly not been discovered, and probably never will; indeed, it's almost certain that it doesn't exist. And that's what Picard is specifically talking about in the teaser, even if he words it a bit funnily in the closing scene.

While it is generally believed that Fermat did not have a valid proof, that is not known for sure. Even if Fermat didn't have a proof, many mathematicians hope that a proof will be found that is much briefer than Wiles', which is over a thousand pages. It's unsatisfying in the sense that the theorem is now known to be true, but the proof doesn't provide an understanding of "why" it's true.