Use the binary exponentiation algorithm to compute....

  • Thread starter Thread starter Math100
  • Start date Start date
  • Tags Tags
    Algorithm Binary
AI Thread Summary
The discussion focuses on using the binary exponentiation algorithm to compute modular exponentiation, specifically for 19 raised to the power of 53 modulo 503 and 141 raised to the power of 47 modulo 1537. The calculations show that 19^53 modulo 503 equals 406, while 141^47 modulo 1537 equals 658. The binary representation of the exponents is utilized to simplify the calculations, breaking them down into smaller powers. An alternative method for the second calculation is mentioned, involving the modular inverse, which may be useful for smaller moduli. Overall, the results of both computations are confirmed to be accurate.
Math100
Messages
813
Reaction score
229
Homework Statement
Use the binary exponentiation algorithm to compute both ## 19^{53}\pmod {503} ## and ## 141^{47}\pmod {1537} ##.
Relevant Equations
None.
First, consider ## 19^{53}\pmod {503} ##.
Then ## 53=(110101)_{2}=2^{5}+2^{4}+2^{2}+1=32+16+4+1 ##.
Note that
\begin{align*}
19^{2}\equiv 361\pmod {503}\\
19^{4}\equiv 44\pmod {503}\\
19^{8}\equiv 427\pmod {503}\\
19^{16}\equiv 243\pmod {503}\\
19^{32}\equiv 198\pmod {503}.\\
\end{align*}
Thus ## 19^{53}\equiv (19^{32}\cdot 19^{16}\cdot 19^{4}\cdot 19)\pmod {503}\equiv (198\cdot 243\cdot 44\cdot 19)\pmod {503} ##.
Therefore, ## 19^{53}\equiv 406\pmod {503} ##.
Next, consider ## 141^{47}\pmod {1537} ##.
Then ## 47=(101111)_{2}=2^{5}+2^{3}+2^{2}+2+1=32+8+4+2+1 ##.
Note that
\begin{align*}
141^{2}\equiv 1437\pmod {1537}\\
141^{4}\equiv 778\pmod {1537}\\
141^{8}\equiv 1243\pmod {1537}\\
141^{16}\equiv 364\pmod {1537}\\
141^{32}\equiv 314\pmod {1537}\\
\end{align*}
Thus ## 141^{47}\equiv (141^{32}\cdot 141^{8}\cdot 141^{4}\cdot 141^{2}\cdot 141)\pmod {1537}\equiv (314\cdot 1243\cdot 778\cdot 1437\cdot 141)\pmod {1537} ##.
Therefore, ## 141^{47}\equiv 658\pmod {1537} ##.
 
Physics news on Phys.org
I checked the first one in detail and both results. Everything is fine.

Only a remark on the second one: you can alternatively calculate
$$
\dfrac{{141}^{32}\cdot {141}^{16}}{141} = {141}^{32}\cdot {141}^{16}\cdot 1428 \pmod {1537}
$$
but I had the computer calculate ##141^{-1} =1428 \pmod {1537}## so I do not know whether this is really an improvement. However, it is something to keep in mind for modules smaller than ##1537##.
 
I tried to combine those 2 formulas but it didn't work. I tried using another case where there are 2 red balls and 2 blue balls only so when combining the formula I got ##\frac{(4-1)!}{2!2!}=\frac{3}{2}## which does not make sense. Is there any formula to calculate cyclic permutation of identical objects or I have to do it by listing all the possibilities? Thanks
Since ##px^9+q## is the factor, then ##x^9=\frac{-q}{p}## will be one of the roots. Let ##f(x)=27x^{18}+bx^9+70##, then: $$27\left(\frac{-q}{p}\right)^2+b\left(\frac{-q}{p}\right)+70=0$$ $$b=27 \frac{q}{p}+70 \frac{p}{q}$$ $$b=\frac{27q^2+70p^2}{pq}$$ From this expression, it looks like there is no greatest value of ##b## because increasing the value of ##p## and ##q## will also increase the value of ##b##. How to find the greatest value of ##b##? Thanks
Back
Top