Pierre de Fermat is one of the greatest mathematicians in history. Alongside Blaise Pascal, he established the foundations of probability theory, which is the mathematics of gambling, risk and chance. Also, when Newton was asked where he got the idea of calculus from, he credited “Monsieur Fermat’s method of drawing tangents”. Already it is clear that Fermat has changed the world we live in, because everybody from insurance companies to stock markets use probability theory, and everybody from architects to NASA use calculus.
But Fermat’s greatest ideas are in the area of number theory. Number theory is the purest form of mathematics, concerned with the study of whole numbers, the relationships between them, and the patterns they form. For example, Fermat showed that 26 is the only number trapped between a square and a cube. Fermat was able to use mathematical logic to prove that no other numbers from zero to infinity have this property. (If you go below zero, then -1 also has this property.)
Perhaps Fermat is most famous for claiming, but not proving, the following theorem:
"It is impossible for a cube to be written as a sum of two cubes, or a fourth power to be written as the sum of two fourth powers, or, in general, for any number which is a power greater than the second to be written as the sum of two like powers...
...I have a truly marvellous demonstration of this proposition which this margin is too narrow to contain."
[Source: http://www.simonsingh.net/Pierre_de_Fermat.html]