Trying to solve Euler Project #77 using Ruby