The equation ax≡b modulo n has a solution exactly when d=gcd(a,n) divides b. If it does, divide a,b,n by d to obtain an equation with an invertible coefficient. It has one residue solution modulo n/d and d distinct solutions modulo n. Dividing the coefficient but leaving the original modulus generally loses solutions. Prime factorisation gives another divisibility tool: if n^k must be divisible by a product of prime powers p^a, each prime exponent in n must be at least ceil(a/k). These minimum exponents independently produce the least positive admissible n. For n⁴ divisible by 2⁷·3⁵, n must contain 2² and 3², so the least value is 36. This is a prime-exponent condition, not a congruence solved by modular division.
The extended Euclidean algorithm expresses gcd(a,n) as ua+vn. When the gcd is 1, u is an inverse of a modulo n. Choose a representative in the required range after reduction. For 7 and 26, 1=15·7−4·26, so 15 is the inverse of 7 modulo 26; verify the product to catch a sign error.
For coprime positive moduli m,n, the Chinese remainder theorem gives exactly one solution modulo mn for each pair of residue conditions. Substitute x=r+mk into the second congruence and solve for k. If the moduli are not coprime, their residue values must agree modulo gcd(m,n); when consistent, uniqueness is modulo the least common multiple, not the product.
Euler's totient phi(n) counts residues coprime to n. For distinct prime divisors p, phi(n)=n times the product of (1−1/p). Euler's theorem gives a^phi(n)≡1 only when gcd(a,n)=1. The prime case is Fermat's little theorem. Reduce exponents only after checking this condition; a nonunit can become zero under repeated powers instead.