(* a. Select the irrational modulus. b. Try different constant factors including the numerators of the convergent of the irrational modulus. c. You can select the length of the subsequence to be displyaed. d. You can also change the offset of the subsequence (in powers of two) to observe the persistance of the patterns. *) Manipulate[ Column@{ Column@{{"First 10 numerators of convergents of ",x},{Convergents[x,10]//Numerator}, ListPlot[N[Mod[k*Prime[Range[min,min+delta]],x],20],Joined->TF,AxesLabel->{n " - offset",},ImageSize->Medium,ImageSize->Medium,ImagePadding->{{10,60},{30,20}}]}, Column@{Style["First Differences of ("<>ToString[k]<>"*prime(n)) mod ("<>ToString[x]<>")"], ListPlot[Differences[N[Mod[k*Prime[Range[min,min+delta]],x],20]],PlotRange->All,AxesLabel->{n " - offset",},ImageSize->Medium,ImagePadding->{{10,60},{30,10}}]}}, {{k,11,"constant factor"},1,2^20,1,Appearance->"Labeled"}, {{x,Pi,"irrational modulus"},{Pi,2Pi,Sqrt[2],Sqrt[3],Sqrt[5],Sqrt[7],GoldenRatio,Sqrt[GoldenRatio],E},Appearance->"PopupMenu"}, {{min,1,"sequence offset"},{2^8,2^10,2^16,2^24,2^32,2^40},Appearance->"PopupMenu"}, {{delta,2^10,"subsequence length"},1,2^16,2^7,Appearance->"Labeled"}, {{TF,True,"Points joined"},{False,True},Appearance->"Labeled"}]