Mod calculator

Powers, inverses and orders modulo mm.

For checking your work after you’ve tried it yourself.

Step 1:
Pick a mode

Power, Inverse or Order.

Step 2:
Fill in the numbers

a, then k or m as asked.

Step 3:
Press Calculate

Compare, then open Do it by hand.
What it does.
Works with remainders. Power finds the remainder of aka^k divided by mm, even for huge kk. Inverse finds xx with ax≡1(modm)ax \equiv 1 \pmod m. Order finds the smallest dd with ad≡1(modm)a^d \equiv 1 \pmod m.
When it helps.
Checking a remainder you found by repeated squaring, or an inverse before you use it.
What it won’t do.
It uses one modulus at a time and doesn't solve equations. Moduli go up to 101810^{18}.
Example.
210=10242^{10} = 1024, so 210≡24(mod1000)2^{10} \equiv 24 \pmod{1000}.
Work out ak mod ma^{k} \bmod m

Spaces and commas are ignored. a can be negative.

Try