You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sicp-all-tasks/sicp/1_002e24

17 lines
444 B

Exercise 1.24: Modify the
timed-prime-test procedure of Exercise 1.22 to use
fast-prime? (the Fermat method), and test each of the 12 primes you
found in that exercise. Since the Fermat test has
Θ
(
log
n
)
growth, how would you expect the time to test primes near 1,000,000 to
compare with the time needed to test primes near 1000? Do your data bear this
out? Can you explain any discrepancy you find?