resolve project euler problems on ruby