Project Euler solutions in ruby