

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


MA 522 Fall 2008
Solution: (i) Zp is a field, therefore the polynomial x^2 − a has at most two roots in Zp. If p = 2 then g = a is the only solution, so S 2 (a) = 1. If p|a then g^2 = a mod p if and only if p|g, so Sp(a) = 1. If 2 6 = p 6 |a then if g^2 = a mod p then (−g)^2 = a mod p, so the num- ber of solutions is even, either 0 or 2. Bothe cases are possible, e.g. S 5 (2) = 0 but S 5 (1) = 0.
(iii) Assume gcd(a, n) = 1. If there exists i such that Spei i(a) = 0, then Sn(a) = 0, otherwise we have that g^2 ≡ a mod n implies that g^2 ≡ a mod pei^. Assume that for each 1 ≤ i ≤ r Spei i(a) > 0 , and take gi ∈ { 0 ,... , pe i i− 1 } such that g i^2 ≡ a mod pe i i. Then by Chinese Remainder algorithm there exists g ∈ { 0 ,... , n − 1 } such that for all i g ≡ gi mod pe i i, thus g^2 ≡ a mod pe i i, which implies that g^2 ≡ a mod n. Therefore, for any list of solutions (g 1 ,... gr) of g^2 i ≡ a mod pe i ifor 1 = 1,... r we can (uniquely) create a solution g^2 ≡ a mod n. This implies that Sn(a) =
∏r i=1 Spei i(a).^ Now applying (ii), and observing that gcd(a, n) = 1 implies that pi 6 |a for all i, we get that Sn(a) =
∏r i=1 Spi (a)
Solution: (i) Assume that N = pe^ and g = 1. Then by Fermat’s little theorem ap−^1 ≡ 1 mod p, and since p − 1 divides pe^ − 1 = N − 1 , we also have that aN^ −^1 ≡ 1 mod p. Thus p divides gcd(aN^ −^1 − 1 , N ), so g 6 = 1. Note that since a is a Fermat witness, aN^ −^1 6 = 1 mod N , there- fore N doesn’t divide aN^ −^1 − 1 , so gcd(aN^ −^1 − 1 , N ) 6 = N.
Solution: INPUT: An odd integer N ≥ 3 and a number L ∈ N such that either L = N − 1 (the default value) or it satisfies aL^ ≡ 1 mod N for all a ∈ Z∗ N. OUTPUT: Either "composite", or a set P = {p : p|N } where each p ∈ P divides N and is prime with probability > 1 / 2. In case N is a Carmichael number and L is the default value, then a set P is returned.
1
Correctness: note that when the original Algorithm 18.5 returned "probably prime", then we return the set with one element {N }, and there we proved that in this case N was a prime with probability at leat 1 / 2. This implies that all elements in the set P are prime with probability at least 1 / 2. Clearly, the elements of P divide N. Also note that the above algorithm returns "composite" iff either in line 5 bk = aL^6 ≡ 1 mod N , or this happens recursively for a proper divisor g of N. If L satisfies aL^ ≡ 1 mod N for all a ∈ Z∗ N then this also implies that aL^ ≡ 1 mod g for any divisor g of N. Therefore, when we call recursively the algorithm with input a divisor g|N and L, then we will have for all a ∈ Z∗ g that aL^ ≡ 1 mod g, thus L satisfies the condition of the input specification and none of the recursive calls will return “composite". This implies that if the algorithm returns "composite" then L must be the default value N − 1 , and N is a composite number by Fermat’s little theorem. Finally, if N is a Carmichael number and L = N − 1 , then for all a ∈ Z∗ N aL^ ≡ 1 mod N. As we argued above, the algorithm in this case will not return “composite", but a set P with elements which are primes with probability at least 1 / 2.
Complexity: Each execution of the above algorithm, without the recursive call has the same complexity as Algorithm 18.5, which is O(log N M(log N )) word operations. There are at most log 2 N recursive calls of the algorithm, since there are at most log 2 N distinct prime divisors of N. Thus the total complexity is at most O(log^2 N M(log N )).
(ii) Assume that 4 |p − 1 , and consider a ∈ Z∗ p such that a generates the cyclic group a ∈ Z∗ p.
Then a
p− 2 1 ≡ − 1 mod p, thus for g := a
p− 4 1 we have that g^2 ≡ − 1 mod p, so − 1 is a square mod p. (iii) clear form the definition.