Way back in 1637, French mathematician Pierre de Fermat wrote a note in the margin of a copy of a math guide called Arithmetica. He claimed to have discovered a rather remarkable proof that was too big to fit in the margin of the book -- fortunately, it seems he used his own copy, or else the librarian would have been much vexed with him.
Fermat never expounded on his proof, and the notes were discovered only after he died some 30 years later -- more proof that he had not, in fact, written in a library book since no librarian would have let his punishment go for that long. The proof concerned a deceptively simple equation: an + bn = cn. People had known about this equation since antiquity, but it had the curious feature of seeming to not be true if n>2. In other words, if n was 1, then the equation was true for any number. You'd recognize that equation as simple arithmetic, in fact.
If n was 2, then the equation was also true for some sets of numbers, called Pythagorean triples. In fact, you'd recognize that as the arithmetical expression of the Pythagorean theorem about the relationship between the length of the sides of a right triangle.
It turned out that the equation breaks down if n is 3 or more. There are no known sets of positive integers where the cube of the sum equals the cube of the two additives. That breakdown continues as n got larger and larger, which led mathematicians to be pretty sure that it would never be true for any n value greater than 2. The problem is that mathematicians don't like "pretty sure" because they deal in a field that has an unending supply of new circumstances. Sure, the equation might not be true when n is 4, (and a special-case proof had been worked out to show just that), but what if n was 51? Without a proof, you had no way of knowing that there might not be some combination of immense numbers which, when raised to the 51st power, made the equation true. And before computers, you had little in the way of methods of doing too much with those immense numbers, let alone repeating that operation my suggested 51 times.
So for the next two centuries, mathematicians slogging away at what became known as Fermat's Conjecture or Fermat's Last Theorem managed to make special-case proofs for the prime numbers 3, 5, and 7. During the last two-thirds of the 19th century, different mathematicians found they could prove the theorem true every time n equaled something called a "regular prime number." I looked up the definition of "regular prime" and my eyes started watering, so we'll leave that out for now.
Once computers got into the mix, the theorem was proved true for n any time it was anything between 2 and somewhere around four million. That's still not the same thing as never true, though.
English mathematician Andrew Wiles, working on leads offered by others who were concerned with the "modularity theorem," which is something else that will make your eyes water, proved Fermat's theorem as a by-product of proving the modularity theorem in 1994. He will receive the 2016 Abel Prize for his work.
The fuller version of the story, along with some better explanations of the math involved, can be found in Simon Singh's 1998 book Fermat's Enigma. Singh notes an irony also observed by many others. While Wiles' proof proved that the original equation would never work for any value of n larger than 2, it used mathematical ideas and concepts which would have been unknown to Pierre de Fermat in 1637. His proof paper, which runs more than 100 pages and has a correction paper of about 20 more, would certainly not have fit in the margin Fermat used, but it's not possible that Fermat himself had sussed out what Wiles and his co-workers had.
Meaning that the most famous math hunt in history was spawned by a scribbled note about an idea for a proof that probably was, as best as anybody today can tell, wrong.