ruby answer to first euler problem