Recently I noticed (on Windows 10, Mathematica 12.1) that changing the limits of RandomInteger, while keeping SeedRandom fixed, does not affect the result and produces a weird non-random non-pseudo random pattern. For example,
Table[SeedRandom[12345678]; RandomInteger[{1, i}], {i, 2, 50}]
returns
{2, 1, 4, 4, 4, 7, 7, 2, 2, 2, 2, 13, 13, 13, 13, 9, 9, 9, 9, 21, 21,21, 21, 21, 26, 26, 26, 26, 26, 26, 26, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18}
Naively I would expect that by changing the range of the random numbers would affect the result, as the chance to get a random integer in the range [1,4] is not the same as in [1,5] even with a fixed SeedRandom.
Moreover, this seems to be affected by the method used in the SeedRandom function:
CountDistinct[Table[SeedRandom[12345678, Method -> #];RandomInteger[{1, i}], {i, 2, 9999}]] & /@ {"Congruential","ExtendedCA", "Legacy", "MersenneTwister", "MKL", "Rule30CA"}
returns the number of distinct numbers
{35, 12, 25, 25, 7514, 25}
which implies that using the MKL method (only available for Intel processors) offers the largest variety.
However, RandomReal gives very different results:
CountDistinct[Table[SeedRandom[12345678, Method -> #];RandomReal[{1, i}], {i, 2, 9999}]] & /@ {"Congruential","ExtendedCA", "Legacy",MersenneTwister", "MKL", "Rule30CA"}
{9998, 9998, 9998, 9998, 9998, 9998}
So, what is going on here? Is there some sort of weird bug in RandomInteger or am I missing something?