Solves Project Euler Problem 012.