Ruby Solution to Project Euler #1