Problem from https://projecteuler.net/