Ruby Solution for Project Euler #3