Uber interview question

Math generate numbers coding question