Solution to Project Euler 11