Completed Euler Problem 5