Project Euler answers in Ruby