Problems 3 and 5 from Project Euler