ដោះស្រាយ​បញ្ហា​គណិតវិទ្យា​ណាមួយ

សមីការ ដឺរេវ៉េ អ៊ីនតេក្រេម ម៉ាទ្រីស ត្រីកោណ ព្រីម ស្ថិតិ ឬ​បញ្ហា​ពាក្យ​ដែល​គ្រូ​បំបែក​ជា​ផ្នែក ។

2^100 mod 13

2,\ 100,\ 13

ជំហាន​ដោយ​ជំហាន

  1. 2^{100} \bmod 13

    Never compute the huge power. Reduce after every multiplication (repeated squaring).

  2. 2 \equiv 2 \pmod{13}

    Reduce the base first.

  3. 100 = 1100100_2

    Write the exponent in binary: 7 squarings at most.

  4. 2^2 \equiv 4 \pmod{13}

    Square the running power.

  5. 4^2 \equiv 3 \pmod{13}

    Square the running power.

  6. r \leftarrow r \cdot 3 \equiv 3 \pmod{13}

    This bit is 1: multiply the result by the current power.

  7. 3^2 \equiv 9 \pmod{13}

    Square the running power.

  8. 9^2 \equiv 3 \pmod{13}

    Square the running power.

  9. 3^2 \equiv 9 \pmod{13}

    Square the running power.

  10. r \leftarrow r \cdot 9 \equiv 1 \pmod{13}

    This bit is 1: multiply the result by the current power.

  11. 9^2 \equiv 3 \pmod{13}

    Square the running power.

  12. r \leftarrow r \cdot 3 \equiv 3 \pmod{13}

    This bit is 1: multiply the result by the current power.

  13. 2^{100} \equiv 3 \pmod{13}

    Done.

បង្ហាញ​ចម្លើយ
2^{100} \bmod 13 = 3