Vyriešte akýkoľvek matematický problém
Rovnice, derivácie, integrály, matice, trojuholníky, prvočísla, štatistiky alebo slovný problém, ktorý učiteľ rozdelí na časti.
Krok za krokom
- 4^{3} \bmod 5
Never compute the huge power. Reduce after every multiplication (repeated squaring).
- 4 \equiv 4 \pmod{5}
Reduce the base first.
- 3 = 11_2
Write the exponent in binary: 2 squarings at most.
- r \leftarrow r \cdot 4 \equiv 4 \pmod{5}
This bit is 1: multiply the result by the current power.
- 4^2 \equiv 1 \pmod{5}
Square the running power.
- r \leftarrow r \cdot 1 \equiv 4 \pmod{5}
This bit is 1: multiply the result by the current power.
- 4^{3} \equiv 4 \pmod{5}
Done.
Odhaliť odpoveď
4^{3} \bmod 5 = 4