Help


from Wikipedia
« »  
An early computer-based PRNG, suggested by John von Neumann in 1946, is known as the middle-square method.
The algorithm is as follows: take any number, square it, remove the middle digits of the resulting number as the " random number ", then use that number as the seed for the next iteration.
For example, squaring the number " 1111 " yields " 1234321 ", which can be written as " 01234321 ", an 8-digit number being the square of a 4-digit number.
This gives " 2343 " as the " random " number.
Repeating this procedure gives " 4896 " as the next result, and so on.
Von Neumann used 10 digit numbers, but the process was the same.

2.570 seconds.