Ruby version of Project-euler problems