Solve any maths problem

Equations, derivatives, integrals, matrices, triangles, primes, statistics — or a word problem the tutor breaks into parts.

7^2 mod 12

7,\ 2,\ 12

Step by step

  1. 7^{2} \bmod 12

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

  2. 7 \equiv 7 \pmod{12}

    Reduce the base first.

  3. 2 = 10_2

    Write the exponent in binary: 2 squarings at most.

  4. 7^2 \equiv 1 \pmod{12}

    Square the running power.

  5. r \leftarrow r \cdot 1 \equiv 1 \pmod{12}

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

  6. 7^{2} \equiv 1 \pmod{12}

    Done.

Reveal the answer
7^{2} \bmod 12 = 1