Ruby solution to Project Euler #11