Project Euler #68: Magic N-gon ring