Project Euler #116: Red, green or blue tiles