cheaty version to solve project euler problem 19