# Exercise 1.28

Here is my modified expmod procedure to signal any nontrivial square root of $$1$$ modulo $$n$$.

The Miller-Rabin test analogous to fermat-test:

We use this test to create a fast-prime alternative that can’t be fooled.

Here are some tests:

In the last three tests we can see that the Miller-Rabin test is not fooled by Carmichael numbers.