I-ScrabbleName
Ii-equations, i-derivates, i-integrals, i-matrices, i-triangles, i-primes, i-statistics — okanye ingxaki yegama ufundi uyamqula iinkalo.
Inyathelo ngenyathelo
- 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.
Bonisa impendulo
4^{3} \bmod 5 = 4