Project Euler #189: Tri-colouring a triangular grid