This is a problem set from Project Euler.