I would like to thank Recreations in the Theory of Numbers by Albert H. Beiler for this problem (#20 on page 296).