Lehmer's method is a type of "Prime Modulus Multiplicative Linear Congruential Generator" which operates in a multiplicative group of integers modulo $m$. The genious of Lehmer's algorithm is that if the multiplier $a$ and prime modulus $m$ are properly chosen, the resulting sequence $\{x_n\}$ will be statistically indistinguishable from a sequence drawn at random from the set $\{1, 2, ..., m-1\}$.
The recursive formula applied in the method is:
There are many ways of choosing the numbers $a$, $m$ and the seed $x_0$. Different values would cause the method to reach its period faster when such numbers are not "good enough".
Let's take an example: $a=6$, $m=13$ and $x_0=1$; The resulting sequence is $\{1, 6, 10, 8, 9, 2, 12, 7, 3, 5, 4, 11, 1, ...\}$, which has a period of $12$.
In general we want our choice of $m$ to be the highest possible prime number, this comes, however, at a big computing cost. For this reason, it's very common to work with numbers $m$ that are a power of $2$. Doing so guarantees us that the period would be at most $m/4$, which is pretty low, but this period would be even smaller when $m$ is even. Due to this, a good option for $m$ is, for example $m = 2^{31}-1 = 2147483647$.
The best choice for $x_0$ is to make it coprime with $m$, this becomes a trivial task when $m$ is prime and a bit more complicaten when it is not. Lehmer suggested $a=7^{5}=16807$ and $m=2^{31}-1$, which is a Mersenne prime number and $0< x_0< 2^{31}-1$. This choice of $a$ generates a full period function, which means it'll have a period of $m-1$
You can now choose different values for $a$, $m$ and $x_0$ and the drawing will paint each pixel black or white depending on weather the random number generated is smaller or greater than $0.5$. A bad choice of $a$, $m$ and $x_0$ will result in an image with a recognizable pattern.
Suggested values: $a =$ 16807, $m =$ 2147483647 $x_0 =$ 14