I'm not sure how much this helps determine periodicity, but here is a way to at least get the same sequence...
from rand(3): pseudo-random number generator - Linux man page
Code:
POSIX.1-2001 gives the following example of an implementation of rand()
and srand(), possibly useful when one needs the same sequence on two
different machines.
static unsigned long next = 1;
/* RAND_MAX assumed to be 32767 */
int myrand(void) {
next = next * 1103515245 + 12345;
return((unsigned)(next/65536) % 32768);
}
void mysrand(unsigned seed) {
next = seed;
}