Project Euler: Problem 35