The twelfth problem from ProjectEuler.net