Use C++11 function iota.
Use Mersenne Twister for random numbers.