When Fermat wrote his note in the margin, he was making a comment on the problem of determining Pythagorean Triples.
In Book II, Problem 8 of the Arithmetica, Diophantus poses the problem of how to divide a given square number into the sum of two smaller squares.
In other words, solve the problem:
x2 + y2 = z2.
Any three numbers that satisfy this equation are called Pythagorean Triples. They are called Pythagorean Triples since this is the same equation as the Pythagorean Theorem.
The Pythagorean Theorem is so well known that I refer people to this link if you would like to see a proof for it.
An example of a Pythagorean Triple is 3, 4, and 5 since 32 + 42 = 52.
I encourage everyone who has not already seen the solution to Diophantus's problem to try and solve it. This is without doubt what Fermat did and in solving this problem, he stumbled upon his famous generalization.
If you solve the problem, you should be able to prove there an infinite number of Pythagorean Triples and find a method for listing them out.
You can find the solution here.
This blog is based on the following sources: