#1: Since , we can say that for some .
So we're trying to find .
Since and is prime, or ... Can you finish off?
#2:
. Can you conclude?
Huh.. It is not said that p is a prime integer..
__________________________________________________
Let d=gcd(a,p). We can say, in particular, that d divides p.
Since p divides both p (obvious) and a (because a is a multiple of p), we can say that p divides the gcd of a and p, that is d.
d | p and p | d
Hence p=d.
Note that the first can be an equivalence#2:
. Can you conclude?