I want you to express the middle square method with the Racket program. In the square extraction method, when the number of digits of the generated random number is n, the square of the initial value s is calculated, and that value is regarded as a 2n digit number (the number of digits squared as shown in the example below). If is not enough, 0 is added.) The n numbers in the center are used as the first random number. Next, square this random number and take the n numbers in the center in the same way to make the next random number.
I want you to express the middle square method with the Racket program.
In the square extraction method, when the number of digits of the generated random number is n, the square of the initial value s is calculated, and that value is regarded as a 2n digit number (the number of digits squared as shown in the example below). If is not enough, 0 is added.) The n numbers in the center are used as the first random number. Next, square this random number and take the n numbers in the center in the same way to make the next random number.


Given:
I want you to express the middle square method with the Racket program.
In the square extraction method, when the number of digits of the generated random number is n, the square of the initial value s is calculated, and that value is regarded as a 2n digit number (the number of digits squared as shown in the example below). It is not enough, 0 is added.) The n numbers in the center are used as the first random number. Next, square this random number and take the n numbers in the center in the same way to make the next random number.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images









