Project Euler problems in ruby