Beispiele für gute und schlechte Parameter von LKG

ClearAll[x];
x[0, a_, c_, m_]={0,0};
x[n_Integer, a_, c_, m_]:=x[n,a,c,m]=Mod[a*x[n-1,a,c,m]+c, m];

m=1000; a={902, 995}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1001; a={902, 995}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1003; a={902, 995}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1000; a={902, 994}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1000; a={901, 994}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1000; a={1, 5}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1000; a={11, 7}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1001; a={11, 7}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1002; a={11, 7}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=1000; a={369, 871}; c={1,1};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=999; a={369, 871}; c={17,53};
ListPlot[x[#,a,c,m]&/@Range[1000]]

m=997; a={369, 871}; c={17,53};
ListPlot[x[#,a,c,m]&/@Range[1000]]

GCD[m, c]
FactorInteger[m]

m=1000; a={21, 121}; c={71,31};
ListPlot[x[#,a,c,m]&/@Range[1000]]

GCD[m, c]
FactorInteger[m]

Inverse Kongruenzgeneratoren

ClearAll[xinv];
PowerInv[0,n_]:=0;
PowerInv[∞,n_]:=0;
PowerInv[x_,n_]:=PowerMod[x,-1,n];
SetAttributes[PowerInv, {Listable}];
xinv[0, a_, c_, p_]=c;
xinv[n_Integer, a_, c_,p_]:=xinv[n,a,c,p]=Mod[a  PowerInv[xinv[n-1,a,c,p],p]+c, p];

m=419; a={215, 311}; c={315,215};
ListPlot[xinv[#,a,c,m]&/@Range[1000]]