Fermat's polygonal number theorem