Back in the ancient times, we used 997 * modulo 1000000 to generate pseudorandom numbers. Each number became the seed for the next number. It was fast, it wasn't too bad statistically, and was useful for many problems we ran on programmable calculators like the HP-41.
My problem: given a six-digit random number, is it possible to calculate the previous random number from which it was generated? If so, how? What if only five digits are retained instead of six?