Version 1.0 solution to project euler #20