PAIBOTLearn
Sign inSign up

Modular arithmetic

Number theory basics

Japanese school year: Math A

What you learn

You will learn how to perform modular arithmetic by grouping integers that share the same remainder when divided by a fixed number. It is useful for finding remainders of large powers and proving periodic properties. A basic understanding of integer division and remainders is recommended beforehand.

Go to practice

Key points

This defines modular congruence, stating that integers aa and bb leave the same remainder when divided by mm. This is equivalent to their difference a−ba - b being an integer multiple of mm.

a≡b(modm)  ⟺  a−b=km(k∈Z)a \equiv b \pmod{m} \iff a - b = km \quad (k \in \mathbb{Z})

This is a fundamental rule for modular arithmetic. As long as the modulus mm is identical, you can add, subtract, and multiply congruences just like regular equations.

a≡b,  c≡d  ⟹  a±c≡b±d,  ac≡bd(modm)a \equiv b, \; c \equiv d \implies a \pm c \equiv b \pm d, \; ac \equiv bd \pmod{m}

Use this property to find the remainder when a large power is divided by mm. Raising both sides to the same power nn preserves congruence, letting you simplify the base aa to a smaller remainder bb first.

a≡b  ⟹  an≡bn(modm)a \equiv b \implies a^n \equiv b^n \pmod{m}

Choose a set to practice.