You want to create integer numbers in a short range - right?
Do you want series that never repeats?
For showing images, it should not matter if it repeats after awhile
A method often used is to use a fraction that does not repeat when expressed as a decimal.It does not take much memory. The numbers are not huge. Just the decimal expression goes on forever.
Look here:
https://docs.python.org/2/library/random.htmlThis module implements pseudo-random number generators for various distributions.
For integers, uniform selection from a range. For sequences, uniform selection of a random element, a function to generate a random permutation of a list in-place, and a function for random sampling without replacement.
On the real line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available.
Almost all module functions depend on the basic function random(), which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes.
Most of that is way beyond what you need. Just a simple random number is all you need. The other stuff is for people doing deep statistical studies.
You will not run out of memory. And if you do, Python will let you know.