Solving project Euler problems using ruby