Get k random numbers between 1 and n and sort