ដោះស្រាយបញ្ហាគណិតវិទ្យាណាមួយ
សមីការ ដឺរេវ៉េ អ៊ីនតេក្រេម ម៉ាទ្រីស ត្រីកោណ ព្រីម ស្ថិតិ ឬបញ្ហាពាក្យដែលគ្រូបំបែកជាផ្នែក ។
ជំហានដោយជំហាន
- 2^{100} \bmod 13
Never compute the huge power. Reduce after every multiplication (repeated squaring).
- 2 \equiv 2 \pmod{13}
Reduce the base first.
- 100 = 1100100_2
Write the exponent in binary: 7 squarings at most.
- 2^2 \equiv 4 \pmod{13}
Square the running power.
- 4^2 \equiv 3 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 3 \equiv 3 \pmod{13}
This bit is 1: multiply the result by the current power.
- 3^2 \equiv 9 \pmod{13}
Square the running power.
- 9^2 \equiv 3 \pmod{13}
Square the running power.
- 3^2 \equiv 9 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 9 \equiv 1 \pmod{13}
This bit is 1: multiply the result by the current power.
- 9^2 \equiv 3 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 3 \equiv 3 \pmod{13}
This bit is 1: multiply the result by the current power.
- 2^{100} \equiv 3 \pmod{13}
Done.
បង្ហាញចម្លើយ
2^{100} \bmod 13 = 3