Project Euler 493 - Under the rainbow

Official link: https://projecteuler.net/problem=493