Here is my solution.
First need to calculate t and s such that n equals 2t  s + 1.
I've written a helper function to calculate t which factors out 2s
to calculate the appropriate value of t.
Then to calculate s we divide.
Ntests is the number of tests needed to get the desired probability
then in this loop I randomly pick an a between one and n
and see if I've tried it before.
If I haven't, I break out of the loop and add it to the side of things that I've tried.
Then we run our first tests, which is to raise a to the power of s, mod in, and see if it's equal to 1.
If that's true, we found an a and can continue to search.
If it fails the first test, we try the second test, which is raising a to the power of 2^(js)
for all j's between 0 and t.
If it passes both tests for all randomly chosen values of a,
we return True.
