Project Euler #209: Circular Logic