गणित समस्या हल करें

समीकरण, अवकलज, समाकलन, आव्यूह, त्रिभुज, अभाज्य संख्याएँ, सांख्यिकी, या कोई शाब्दिक प्रश्न जिसे ट्यूटर हिस्सों में बाँटता है।

5^20 mod 21

5,\ 20,\ 21

चरण दर चरण

  1. 5^{20} \bmod 21

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

  2. 5 \equiv 5 \pmod{21}

    Reduce the base first.

  3. 20 = 10100_2

    Write the exponent in binary: 5 squarings at most.

  4. 5^2 \equiv 4 \pmod{21}

    Square the running power.

  5. 4^2 \equiv 16 \pmod{21}

    Square the running power.

  6. r \leftarrow r \cdot 16 \equiv 16 \pmod{21}

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

  7. 16^2 \equiv 4 \pmod{21}

    Square the running power.

  8. 4^2 \equiv 16 \pmod{21}

    Square the running power.

  9. r \leftarrow r \cdot 16 \equiv 4 \pmod{21}

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

  10. 5^{20} \equiv 4 \pmod{21}

    Done.

जवाब दिखाएँ
5^{20} \bmod 21 = 4