Answer:
The solution is written in Python
- a= 32310901
- b= 1729
- m= 224
-
- rold = int(input("Enter an initial value: "))
-
- for i in range(100):
- rnew = (a * rold + b) % m
- print(rnew)
- rold = rnew
Step-by-step explanation:
Firstly, declare variable a, b and m and initialize them with preset value as given in the question (Line 1-3).
Next, use input function to prompt use to input an initial value and then assigns it rold variable.
Create a for-loop that will run for 100 iterations (Line 7). Next, apply the random generator formula to generate a random number and assign it to rnew (Line 8). Print the rnew (Line 9) and set the current rnew to overwrite the value of rold (Line 10).
The program will generate 100 random integers.