<<"BarCharts`";<<"Histograms`" ;
<<"PieCharts`"

nkalphatester[num_, k_, alpha_, precision_] := Module[{},
dataset = {};
scale  = 1;
If[precision == 1, scale = 1.0];
For[n = 1, n ≤ num, n++, dataset = AppendTo[dataset, scale * Mod[scale * (n^k) alpha,1]]];
dataset = Sort[dataset];
Print["Histogram of data."];
Print[Histogram[dataset, HistogramScale -> 1]];
diffset = {};
For[n = 1, n ≤ num-1, n++, diffset = AppendTo[diffset, (dataset[[n+1]] - dataset[[n]])*num]];
Print["Histogram of normalized differences."];
Print[Histogram[diffset, HistogramScale -> 1]];
actualdiff = {};
For[n = 1, n ≤ num-1, n++,
If[MemberQ[actualdiff,diffset[[n]]] == False, actualdiff = AppendTo[actualdiff, diffset[[n]]]]];
Print["The observed differences are: ", actualdiff];
];

nkalphatester[10000,1,Sqrt[1],0]