Lec 03
Lec 03
When applying the Euclidean algorithm for the integers a and b �= 0, the
last non-zero remainder is the greatest common divisor of a and b.
Furthermore, if d := gcd(a, b), then the equation
ax + by = d
gcd(1227, 216) = 3
Bernadett Aradi, Ágnes Baran Discrete mathematics 2021 Fall 1 / 15
Definition
Equations of the form ax + by = c (where a, b, c ∈ Z are known, x, y ∈ Z
are unknown) are called linear Diophantine equations.
Theorem
The linear Diophantine equation ax + by = c is solvable if, and only if,
gcd(a, b)|c.
Theorem
If the Diophantine equation ax + by = c is solvable, then it has infinitely
many solutions, which can be written in the form
b a
x = x0 + t , y = y0 − t , t ∈ Z,
gcd(a, b) gcd(a, b)
Theorem
An integer p > 1 is prime if, and only if, p|ab implies p|a or p|b.
Example
Determine gcd(1260, 14850) and lcm(1260, 14850).
Remark
The integers a and b are coprime numbers if there are no common prime
factors in their canonical representation.
Theorem
The value of Euler’s ϕ function can be calculated by the formula
�r � �
1
ϕ(m) = m · 1− ,
pi
i=1
Theorem
The (linear) congruence equation ax ≡ b (mod m) is solvable among
integers if, and only if, gcd(a, m)|b.
Proof: we can derive a Diophantine equation from the congruence
equation:
ax ≡ b (mod m) ⇔ m|(ax − b) ⇔
⇔ ∃y ∈ Z : my = ax − b ⇔ ax − my = b
Solution 1:
Solve the linear Diophantine equation 12x − 16y = 8 (i.e. 3x − 4y = 2)
Solution 2:
12 8 16
Consider the equation gcd(12,16) x ≡ gcd(12,16) (mod gcd(12,16) )
Then
3x ≡ 2 (mod 4)
3x ≡ 2 + 4 = 6 (mod 4)
x ≡2 (mod 4) (because gcd(3, 4) = 1)
The solutions:
x = . . . , −10, −6, −2, 2, 6, 10, . . .