Project Euler 226 - A Scoop of Blancmange

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