Middlesquares
Middlesquares is a pseudorandom number generator algorithm, developed by John von Neumann in 1946. It is a simple and early method for generating sequences of numbers that appear random. The algorithm works by squaring a number, then extracting the middle digits of the result to form the next number in the sequence. For example, if the starting number is 1234, squaring it gives 1522756, and the middle digits (2275) form the next number in the sequence.
The middlesquares algorithm is easy to implement and understand, but it has several limitations. It can produce