Wednesday, 17 January 2018

elementary number theory - Fast modular exponentiation



Suppose that p and q are distinct primes, then for every integer a and exponent e with e(mod(p1)(q1)) show that:
aeaemod(p1)(q1)(modpq).



I tried to prove it this way:



Let n=pq, gcd(p,q)=1 and e=emodφ(n), then e=mφ(n)+e,mZ. We have ae=amφ(n)+e=(aφ(n))maeae(modn). The last step is true based on the Euler's totient theorem.




Unfortunately, this proof is correct if and only if a is relatively prime to n. However, the task asks to prove it for every integer a and exponent e. How to prove it in that case?


Answer



Case#1: If p|a clearly the aeaemod(p1)(q1)(modp) holds as e>0



and similarly for q



Case#2: If p\nmid a\iff (a,p)=1, a^{p-1}\equiv1\pmod p



\implies a^{\text{lcm}(p-1,q-1)}\equiv1\pmod p

and similarly, a^{\text{lcm}(p-1,q-1)}\equiv1\pmod q for q\nmid a\iff(a,q)=1



\implies a^{\text{lcm}(p-1,q-1)}\equiv1\pmod{pq}



Let e=r+k\cdotlcm(p-1,q-1) where r is any integer



a^e=a^r\cdot (a^{\text{lcm}(p-1,q-1)})^k\equiv a^r\cdot1^k\pmod{pq}


No comments:

Post a Comment

real analysis - How to find lim_{hrightarrow 0}frac{sin(ha)}{h}

How to find \lim_{h\rightarrow 0}\frac{\sin(ha)}{h} without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...