This code is based in the Spectral Test algorithm on page 102 of the book "The Art of Computer Programming" by Donald Knuth.
The spectral test is a statistical test.It evaluates the quality of the linear congregational generators (LCGs), that are a class of pseudorandom generators (PRNGs)
for 2 < t < T, given a, m, and T, where 0 < a < m and a is relatively prime to m. (The minimum is taken over all nonzero integer vectors (x 1 , ... , Xt), and the number Vt measures the t-dimensional accuracy of random number generators.
The steps performed presented in the book are the following: