############### # Example of bad PRNG which will give problems in N=32+4*64 x=rep(NaN,N) a=101 c = 17 m = 64 x[1]=m/2 for (i in 2:N) { x[i]= (a*x[i-1]+c)%% m } par(mfrow=c(2,1)) plot(x,main='Period 64 on (a bad) PRNG') hist(x,(0:m)-0.5,main='Histogram after N samples')