Ruby problem solution code for http://projecteuler.net/