On the Converse of Fermat's Theorem