Ruby solution to Project Euler Problem #11