Britannica Sources used in this answer

Why is division by 2 possible modulo 5 but impossible modulo 4?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In modular arithmetic, division by a number s modulo N is defined as finding a value X such that s×X≡1(modN).

Division by 2 is possible modulo 5 because 2 and 5 are relatively prime—meaning their only common factor is 1. Specifically, 2×3=6, and since 6≡1(mod5), the value 3 acts as the multiplicative inverse of 2, making 1÷2≡3(mod5).

Conversely, division by 2 is impossible modulo 4 because 2 and 4 are not relatively prime; they share a common factor of 2. For any integer X, the product 2×X will always be an even number. In modulo 4, the possible values for 2×X are 2×0≡0, 2×1≡2, 2×2≡0, and 2×3≡2. Because none of these products result in 1, there is no solution for X in the equation 2×X≡1(mod4).1