Most of these mistakes were later corrected, either by their authors or by others. It is reassuring to see even the greatest scientists make mistakes, but for them those mistakes sometimes prove fruitful. Making mistakes that lead in the right direction is an art in itself!
Euler and factorization -------------------------
Working in St Petersburg, the Swiss mathematician Leonhard Euler proved Fermat's Last Theorem for exponent 3: the equation x3 + y3 = z3 has no integer solutions. He used Fermat's method of infinite descent: to prove that no positive integer has a given property, we assume that one does and construct a new solution strictly smaller than the previous one. We repeat the process with this new solution to obtain a third, strictly smaller solution, then a fourth… But an infinite strictly decreasing sequence of natural numbers cannot exist.

Leonhard Euler (1707–1783).