ruby nth prime solution