Chapter

Modular Arithmetic II: Linear Congruences and Systems

The module teaches solving linear congruences, using inverses, knowing when division is allowed, checking system compatibility, and constructing numbers with prescribed remainders.
Log in to track solved progress and bookmarks.

Theory

Key Idea

A linear congruence \(ax\equiv b\pmod m\) resembles a linear equation, but division is not always allowed. The main question is whether the coefficient \(a\) is compatible with the modulus \(m\).

If \(\gcd(a,m)=1\), then \(a\) has an inverse modulo \(m\). If \(\gcd(a,m)>1\), the congruence may have no solutions or several residue classes of solutions.

Basic Facts

  • The congruence \(ax\equiv b\pmod m\) has solutions if and only if \(\gcd(a,m)\mid b\).
  • If \(d=\gcd(a,m)\mid b\), divide \(a,b,m\) by \(d\) and solve \(\frac adx\equiv\frac bd\pmod{\frac md}\).
  • If \(\gcd(a,m)=1\), then \(a\) has a multiplicative inverse modulo \(m\).
  • The system \(x\equiv r\pmod m\), \(x\equiv s\pmod n\) is compatible if and only if \(r\equiv s\pmod{\gcd(m,n)}\).
  • If the moduli are coprime, the system has a unique solution modulo the product of the moduli.

When to Use This Method

  • A number must be found from several remainders.
  • An expression \(ax+b\) is divisible by \(m\).
  • You must decide whether a congruence may be divided by a common factor.
  • Remainder conditions have non-coprime moduli.
  • A divisibility condition \(f(n)\mid g(n)\) reduces to a variable divisor dividing a constant.

How to Recognise the Method

If the statement gives several remainders, write a system of congruences immediately. If \(ax\equiv b\pmod m\) appears, first compute \(\gcd(a,m)\), rather than trying to divide by \(a\).

For systems with non-coprime moduli, first check compatibility modulo the common divisor of the moduli.

Typical Mistakes

  • Dividing \(6x\equiv12\pmod{18}\) by \(6\) while keeping modulus \(18\), losing solutions.
  • Forgetting that one congruence can have several solutions modulo the original modulus.
  • Applying the Chinese remainder theorem to non-coprime moduli without checking compatibility.
  • Finding one solution of a system but not stating the modulus of all solutions.
  • In divisibility problems, failing to check the candidates found.

Mini-Checklist

  • What is \(\gcd(a,m)\) in \(ax\equiv b\pmod m\)?
  • Does this GCD divide the right-hand side?
  • Did the modulus change after division?
  • Are the residues compatible modulo common divisors of moduli?
  • Modulo what number should the final answer be written?

Examples

Example 1. Multiplicative Inverse

If the coefficient is coprime to the modulus, it can be inverted.

Problem. Solve \(3x\equiv5\pmod7\).

Solution.

The inverse of \(3\) modulo \(7\) is \(5\), because \(3\cdot5\equiv1\). Multiply: \(x\equiv5\cdot5=25\equiv4\pmod7\).

Comment. This is the correct replacement for division.

Example 2. No Solutions

Before dividing, check the GCD.

Problem. Solve \(6x\equiv5\pmod9\).

Solution.

\(\gcd(6,9)=3\), but \(3\nmid5\). Therefore the congruence has no solutions.

Comment. One GCD check settles the problem.

Example 3. Several Solutions

If the common divisor divides the right side, several solutions appear.

Problem. Solve \(6x\equiv12\pmod{18}\).

Solution.

Divide \(6,12,18\) by \(6\): \(x\equiv2\pmod3\). Modulo \(18\), this gives \(x\equiv2,5,8,11,14,17\pmod{18}\).

Comment. The modulus changed; this is the main source of mistakes.

Example 4. A Simple System

For coprime moduli, the solution is unique modulo their product.

Problem. Solve \(x\equiv2\pmod3\), \(x\equiv3\pmod5\).

Solution.

The numbers \(2,5,8,11,\ldots\) have residue \(2\) modulo \(3\). Among them, \(8\equiv3\pmod5\). Hence \(x\equiv8\pmod{15}\).

Comment. One may search within one residue class.

Example 5. Incompatible Conditions

Non-coprime moduli require a common-divisor check.

Problem. Prove that the system \(x\equiv2\pmod6\), \(x\equiv3\pmod9\) has no solutions.

Solution.

If \(x\equiv2\pmod6\), then \(x\equiv2\pmod3\). If \(x\equiv3\pmod9\), then \(x\equiv0\pmod3\). One number cannot have two different residues modulo \(3\). No solutions exist.

Comment. This is compatibility modulo \(\gcd(6,9)=3\).

Example 6. Compatible Non-Coprime Moduli

If residues agree modulo the common divisor, the system can be solved.

Problem. Solve \(x\equiv4\pmod6\), \(x\equiv10\pmod{15}\).

Solution.

Both residues are \(1\) modulo \(3\), so the system is compatible. Let \(x=6k+4\). Then \(6k+4\equiv10\pmod{15}\), so \(6k\equiv6\pmod{15}\). Divide by \(3\): \(2k\equiv2\pmod5\), hence \(k\equiv1\pmod5\). Thus \(x\equiv10\pmod{30}\).

Comment. The answer is written modulo \(\operatorname{lcm}(6,15)=30\).

Example 7. A System from the Statement

Sometimes the conditions already contain a hidden contradiction.

Problem. Find all \(x\pmod{84}\) such that \(x\equiv2\pmod3\), \(x\equiv3\pmod7\), \(x\equiv4\pmod{12}\).

Solution.

From \(x\equiv4\pmod{12}\), we get \(x\equiv1\pmod3\). But the first condition requires \(x\equiv2\pmod3\). Contradiction, so there are no solutions.

Comment. Check compatibility before computing.

Example 8. Divisibility Reduces to a Constant

A variable divisor can be forced to divide a small number.

Problem. Find all positive \(n\) such that \(2n+1\mid n^2+n+7\).

Solution.

If \(2n+1\mid n^2+n+7\), then it divides \(4(n^2+n+7)=(2n+1)^2+27\). Hence \(2n+1\mid27\). Since \(n>0\), \(2n+1\in\{3,9,27\}\). Thus \(n=1,4,13\), and all three values work.

Comment. This is not a direct congruence, but it leads to a linear restriction.

Problems

Problems

#6.1
#6.1

Simple Congruence

Linear Congruence Grade 8 Grade 9 ★☆☆☆☆

Solve \(x+3\equiv1\pmod7\).

Details
Problem: NT-B1-M04-P001
Difficulty: Level 1 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.2
#6.2

Inverse of 3

Linear Congruence Grade 8 Grade 9 ★☆☆☆☆

Solve \(3x\equiv1\pmod7\).

Details
Problem: NT-B1-M04-P002
Difficulty: Level 1 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.3
#6.3

Inverse of 5 Modulo 12

Modular Inverse Grade 8 Grade 9 ★☆☆☆☆

Find the inverse of \(5\) modulo \(12\).

Details
Problem: NT-B1-M04-P003
Difficulty: Level 1 of 5
Tag: Modular Inverse
Grade: Grade 8, Grade 9
#6.4
#6.4

Two Coprime Moduli

System Of Congruences Grade 8 Grade 9 ★☆☆☆☆

Solve the system \(x\equiv2\pmod3\), \(x\equiv1\pmod5\).

Details
Problem: NT-B1-M04-P004
Difficulty: Level 1 of 5
Tag: System Of Congruences
Grade: Grade 8, Grade 9
#6.5
#6.5

Cannot Divide Without Checking

Linear Congruence Grade 8 Grade 9 ★☆☆☆☆

Prove that \(2x\equiv1\pmod4\) has no solutions.

Details
Problem: NT-B1-M04-P005
Difficulty: Level 1 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.6
#6.6

Congruence with Two Solutions

Linear Congruence Grade 8 Grade 9 ★★☆☆☆

Solve \(4x\equiv6\pmod{10}\).

Details
Problem: NT-B1-M04-P006
Difficulty: Level 2 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.7
#6.7

Six Solutions

Linear Congruence Grade 8 Grade 9 ★★☆☆☆

Solve \(6x\equiv12\pmod{18}\).

Details
Problem: NT-B1-M04-P007
Difficulty: Level 2 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.8
#6.8

The Congruence \(9x\equiv6\)

Linear Congruence Grade 8 Grade 9 ★★☆☆☆

Solve \(9x\equiv6\pmod{15}\).

Details
Problem: NT-B1-M04-P008
Difficulty: Level 2 of 5
Tag: Linear Congruence
Grade: Grade 8, Grade 9
#6.9
#6.9

Remainders 3 and 2

System Of Congruences Grade 8 Grade 9 ★★☆☆☆

Solve the system \(x\equiv3\pmod4\), \(x\equiv2\pmod5\).

Details
Problem: NT-B1-M04-P009
Difficulty: Level 2 of 5
Tag: System Of Congruences
Grade: Grade 8, Grade 9
#6.10
#6.10

Incompatible System

No Solution Grade 8 Grade 9 ★★☆☆☆

Prove that the system \(x\equiv2\pmod6\), \(x\equiv3\pmod9\) has no solutions.

Details
Problem: NT-B1-M04-P010
Difficulty: Level 2 of 5
Tag: No Solution
Grade: Grade 8, Grade 9
#6.11
#6.11

Compatible Moduli 6 and 9

System Of Congruences Grade 8 Grade 9 ★★☆☆☆

Solve \(x\equiv4\pmod6\), \(x\equiv1\pmod9\).

Details
Problem: NT-B1-M04-P011
Difficulty: Level 2 of 5
Tag: System Of Congruences
Grade: Grade 8, Grade 9
#6.12
#6.12

Smallest Number from Two Remainders

Construction Grade 8 Grade 9 ★★☆☆☆

Find the smallest positive number that leaves remainder \(2\) modulo \(5\) and remainder \(3\) modulo \(7\).

Details
Problem: NT-B1-M04-P012
Difficulty: Level 2 of 5
Tag: Construction
Grade: Grade 8, Grade 9
#6.13
#6.13

Criterion for a Linear Congruence

GCD Grade 9 Grade 10 ★★★☆☆

Prove that \(ax\equiv b\pmod m\) has a solution if and only if \(\gcd(a,m)\mid b\).

Details
Problem: NT-B1-M04-P013
Difficulty: Level 3 of 5
Tag: GCD
Grade: Grade 9, Grade 10
#6.14
#6.14

Divisibility by \(2n+1\)

Divisibility Grade 9 Grade 10 ★★★☆☆

Find all positive \(n\) such that \(2n+1\mid n^2+n+7\).

Details
Problem: NT-B1-M04-P014
Difficulty: Level 3 of 5
Tag: Divisibility
Grade: Grade 9, Grade 10
#6.15
#6.15

System Modulo 84

No Solution Grade 9 Grade 10 ★★★☆☆

Find all \(x\pmod{84}\) such that \(x\equiv2\pmod3\), \(x\equiv3\pmod7\), \(x\equiv4\pmod{12}\).

Details
Problem: NT-B1-M04-P015
Difficulty: Level 3 of 5
Tag: No Solution
Grade: Grade 9, Grade 10
#6.16
#6.16

Three Coprime Moduli

Chinese Remainder Theorem Grade 9 Grade 10 ★★★☆☆

Solve \(x\equiv5\pmod8\), \(x\equiv2\pmod9\), \(x\equiv1\pmod5\).

Details
Problem: NT-B1-M04-P016
Difficulty: Level 3 of 5
Tag: Chinese Remainder Theorem
Grade: Grade 9, Grade 10
#6.17
#6.17

Solve the Linear Congruence First

Linear Congruence Grade 9 Grade 10 ★★★☆☆

Find all \(x\pmod{60}\) such that \(4x\equiv8\pmod{12}\) and \(x\equiv3\pmod5\).

Details
Problem: NT-B1-M04-P017
Difficulty: Level 3 of 5
Tag: Linear Congruence
Grade: Grade 9, Grade 10
#6.18
#6.18

Three Remainders

Construction Grade 9 Grade 10 ★★★☆☆

Find the smallest positive \(n\) such that \(n\equiv1\pmod2\), \(n\equiv2\pmod3\), \(n\equiv3\pmod5\).

Details
Problem: NT-B1-M04-P018
Difficulty: Level 3 of 5
Tag: Construction
Grade: Grade 9, Grade 10
#6.19
#6.19

Number of Solutions

Linear Congruence Grade 9 Grade 10 ★★★☆☆

Find all solutions of \(12x\equiv18\pmod{30}\).

Details
Problem: NT-B1-M04-P019
Difficulty: Level 3 of 5
Tag: Linear Congruence
Grade: Grade 9, Grade 10
#6.20
#6.20

Modulo 100

Chinese Remainder Theorem Grade 9 Grade 10 ★★★☆☆

Find all \(x\pmod{100}\) such that \(x\equiv3\pmod4\) and \(x\equiv7\pmod{25}\).

Details
Problem: NT-B1-M04-P020
Difficulty: Level 3 of 5
Tag: Chinese Remainder Theorem
Grade: Grade 9, Grade 10
#6.21
#6.21

Compatibility Criterion for Two Congruences

Compatibility Grade 9 Grade 10 ★★★★☆

Prove: the system \(x\equiv r\pmod m\), \(x\equiv s\pmod n\) has a solution if and only if \(r\equiv s\pmod{\gcd(m,n)}\).

Details
Problem: NT-B1-M04-P021
Difficulty: Level 4 of 5
Tag: Compatibility
Grade: Grade 9, Grade 10
#6.22
#6.22

Divisibility by \(3n+2\)

Divisibility Grade 9 Grade 10 ★★★★☆

Find all positive \(n\) such that \(3n+2\mid n^2+5n+9\).

Details
Problem: NT-B1-M04-P022
Difficulty: Level 4 of 5
Tag: Divisibility
Grade: Grade 9, Grade 10
#6.23
#6.23

Minus One and Zero

Construction Grade 9 Grade 10 ★★★★☆

Find the smallest positive \(n\) such that \(n\equiv-1\pmod2\), \(n\equiv-1\pmod3\), \(n\equiv-1\pmod5\), but \(n\equiv0\pmod7\).

Details
Problem: NT-B1-M04-P023
Difficulty: Level 4 of 5
Tag: Construction
Grade: Grade 9, Grade 10
#6.24
#6.24

Mixed System

Linear Congruence Grade 9 Grade 10 ★★★★★

Find all \(x\pmod{420}\) satisfying \(x\equiv1\pmod4\), \(x\equiv2\pmod5\), \(x\equiv3\pmod7\), \(6x\equiv12\pmod9\).

Details
Problem: NT-B1-M04-P024
Difficulty: Level 5 of 5
Tag: Linear Congruence
Grade: Grade 9, Grade 10

Ladders

No published ladders were found.
Previous Chapter
Next Chapter