%period.m-This file will test different values for a coefficient in a
function [per]=period(amax)
%congruential random number generator and determine the period for that
%value

b=0;
m=8192;
x0=1;
j=0;

for a=1: amax
    
    y(1)=mod(a*x0,m);
    
    for i=2: 8192
        
        y(i)=mod(a*y(i-1),m);
        
        if y(i)==0, per(a)=0, break,end;
            
        if y(i)==y(1),per(a)=i-1,break,end;
               
    end
end

