I use square root of any prime number, although the truth is any prime root, the sequence is infinite and the test counting the digits from 0 to 9, when the sequence is very large the count of the digits tends to equality or 1 / 10 probability for digit, in programming BigDicemal use, I hope it has helped you!
You would not just test a number, you would test a long sequence of numbers, for randomness.
I've written two such tests. In one test, I take each two adjacent numbers in the long number sequence, and I use every such pair as the x and y coordinates of a 2D space. Then I plot each dot on the screen. Over time, you will see the blank screen filling up with dots. This is more or less an intuitive test. If you see any kind of pattern forming, repeatedly for each attempt, that number sequence is not random. If instead the screen gets filled in "randomly," with perhaps occasional clusters here and there, and any clustering is different with every new seed value, and otherwise mostly even fill, then you can conclude the sequence of numbers is random. Over time, there should remain no blank spots on the screen, and no places "overpopulated" with dot. Over time, the screen should become evenly filled with dots.
The other test I wrote is more rigorous. I take the random numbers, let's say they can vary from 0 to 1, and I do three things with each new number: (1) check whether it the smallest or the largest in the sequence so far, (2) place it in one of many bins, depending on its value, and (3) compute a running average. The bins can be something like, any number >= 0 but < 0.1 goes in bin #1, any number >= 0.1 but < 0.2 goes in bin #2, and so on, until the last bin contains any number >= 0.9 but
It is not clear that, if the two (active) tests that are proposed and described by Albert, are his work, or they selected from others work. The convergence of the (random sequence) of numbers is not guaranteed, but for enough large inputs the sequence of numbers should have at least one limit point, this is because the data values vary in a compact domain.
I use square root of any prime number, although the truth is any prime root, the sequence is infinite and the test counting the digits from 0 to 9, when the sequence is very large the count of the digits tends to equality or 1 / 10 probability for digit, in programming BigDicemal use, I hope it has helped you!
Issam, I thought about and wrote those two tests myself, to test the PRNG in my compiled QuickBasic language. Although I did see the idea of drawing dots in 2D space somewhere else.
Adolfo makes a good suggestion too, for sequences that should be random. Another one is to take the individual digits of pi, as the sequence. But I would put them through the two tests anyway, just to prove it to myself that these are roughly random.
And I agree with you on the point that these results are not guaranteed. For example, it is infinitesimally possible that a random number sequence will be a long series of the same exact number. So, should a particular seed value produce such oddity, over a noticeably long amount of time, you might just wonder if the sequence is random. If this happens more than once in a lifetime, though, I would be skeptical!
Congratulations, it is an excellent idea to test PRNG and RNG in general.
I don't have any objections about (convergence), the accumulation of the sequence of numbers is a must about at least one point, but the (uniqueness) is not guaranteed.
It is well known that any infinite set in a compact domain has at least one limit point, so it may be the dots that represent PRNG (RNG) accumulate around many points in the 2D domain.
PS: the digits of pi are deterministic (predictable) where the exact value of the nth-digit up to any order can be determined via many algorithms such as the continued fraction.