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.
extended Euclidean algorithm แสดง gcd(a,n) เป็น ua+vn. เมื่อ gcd เป็น 1, u เป็น inverse ของ a mod n. เลือก representative ในช่วงที่ต้องการหลังจาก reduction. สำหรับ 7 และ 26, 1=15·7−4·26, ดังนั้น 15 เป็น inverse ของ 7 mod 26; ตรวจสอบผลคูณเพื่อจับ error sign
สำหรับโมดูลัส m,n ที่ coprime (จำนวนร่วมตัวประกอบ prime ไม่เหมือนกัน) ทฤษฎีบทเศษเหลือจีนให้คำตอบที่แน่นอนเพียงหนึ่งค่า modulo mn สำหรับแต่ละคู่ของเงื่อนไขเศษเหลือ แทนค่า x=r+mk ลงในอสมการ congruence ตัวที่สองแล้วแก้หาค่า k หากโมดูลัสไม่ใช่ coprime ค่าเศษเหลือต้องตรงกัน modulo gcd(m,n); เมื่อสอดคล้องกัน ความไม่ซ้ำซ้อนจะอยู่ modulo least common multiple ไม่ใช่ผลคูณ
Euler's totient phi(n) นับจำนวนเศษเหลือที่เป็น coprime กับ n สำหรับตัวประกอบ prime แยกต่างหาก p, phi(n)=n คูณด้วยผลคูณของ (1−1/p) ทฤษฎีบทของ Euler บอกว่า a^phi(n)≡1 ก็ต่อเมื่อ gcd(a,n)=1 กรณีของจำนวน prime คือทฤษฎีบทเล็กของ Fermat ลดเลขชี้กำลังได้ก็ต่อเมื่อตรวจสอบเงื่อนไขนี้แล้วเท่านั้น; จำนวนที่ไม่ใช่ unit อาจกลายเป็นศูนย์ภายใต้การยกกำลังซ้ำๆ แทน