As a part of my coursework I need to find and re-code a rand() random number generator which outputs the same numbers as the original. The starting sequence is 1804289383 846930886 1681692777 1714636915 1957747793 424238335 719885386 1649760492 596516649 1189641421 1025202362 and can be generated at http://ideone.com/H7tsSI
#include <stdlib.h> /* rand */
#include <iostream>
using namespace std;
int main ()
{
for (int i = 0 ; i< 10 ; i++) {
cout << rand() << " ";
}
cout << rand();
return 0;
}
My issue is that I can't find the original source of this generator, and I don't know how I can figure out the way the generator works from the full sequence of the generator, which is 100 numbers long. Could someone help me either find the original generator or teach me how I can find a generator from its sequence? Thanks!