Divisibility
Divisibility
• x | x ∀ x ̸= 0
• 1|x ∀x
• x | 0 ∀ x ̸= 0
• x | y and y | z =⇒ x | z
n | n2 + n + 2 − 1(n2 + n) =⇒ n | 2 =⇒ n = 1, 2.
Lemma: x | y and y | x =⇒ x = ±y
Euclid’s Division Lemma: Given two integers, a (the dividend) and b (the divisor), where
b ̸= 0, there exist unique integers q (the quotient) and r (the remainder) such that: a = bq + r
where 0 ≤ r < |b|.
Fundamental Theorem of Arithmetic: Any natural number greater than 1 has a unique
prime factorization upto order.
=⇒ N = {p1 , p1 , . . . , p1 , p2 , p2 , . . . , p2 , . . . , pk , pk , . . . , pk }
| {z } | {z } | {z }
e1 times e2 times ek times
Greatest Common Divisor: The Greatest Common Divisor (GCD) of two or more inte-
gers is the largest positive integer that divides each of the given numbers without leaving a
remainder. It represents the greatest shared factor among the numbers.
Properties of GCD: Here we denote the greatest common divisor of a and b by (a, b).
1
3. If (b, c) = g, (b/g, c/g) = 1
7. if a | b, then (a, b) = a
14. gcd(gcd(m, n), p) = gcd(m, gcd(n, p)); proving that gcd(m, n, p) is well defined.
Least Common Multiple: The Least Common Multiple (LCM) of two or more integers is
the smallest positive integer that is a multiple of each of the given numbers. It represents the
smallest number that both (or all) given numbers can divide evenly. We denote the LCM of a
and b by [a, b].
gcd(a, b) × lcm(a, b) = ab
Divisibility Tests:
3. Divisibility by 4: A number is divisible by 4 if the last two digits form a number divisible
by 4.
10. Divisibility by 11: A number is divisible by 11 if the alternating sum of its digits is
divisible by 11.
2
12. Divisibility by 13: A number is divisible by 13 if the difference between 9 times the last
digit and the rest of the number is divisible by 13.
15. Divisibility by 17: A number is divisible by 17 if the difference between 5 times the last
digit and the rest of the number is divisible by 17.
16. Divisibility by 25: A number is divisible by 25 if its last two digits are 00, 25, 50, or 75.
17. Divisibility by 125: A number is divisible by 125 if the number formed by its last three
digits is divisible by 125.
Euclidean Algorithm
The Euclidean algorithm is a method for finding the greatest common divisor (GCD) of two
integers. It operates on the principle that the GCD of two numbers remains unchanged if the
larger number is replaced by its remainder when divided by the smaller number, iteratively.
Here’s a simplified breakdown:
1. Step 1: Given two integers a and b, where a is greater than or equal to b, divide a by b
to get a quotient q and a remainder r.
2. Step 2: If r is zero, then b is the GCD of a and b. If r is non-zero, proceed to the next
step.
3. Step 3: Replace a by b and b by r, and repeat Step 1 with the new values.
4. Step 4: Continue this process until the remainder becomes zero. The GCD is the last
non-zero remainder obtained.
Lemma: Let a, b be integers. We can write a = bq + r for integers q,r where 0 ≤ r < b. Then
the lemma states that: (a, b) = (r, b) =⇒ (a, b) = (a ± kb, b)
Base Systems: Base systems are methods of representing numbers using a set of digits and
a base. The base determines the number of unique digits, including zero, that a positional
numeral system uses to represent numbers.
Positional Notation: Each digit in a number has a position, and the value of the digit is
determined by its position (place value) as well as the base. A number dn dn−1 . . . d1 d0 in base
b is interpreted as: dn × bn + dn−1 × bn−1 + · · · + d1 × b1 + d0 × b0
3
To convert a number from base b to the decimal (base 10) system, follow these steps:
• Express the number as a sum of its digits multiplied by the corresponding powers of
the base b:
N10 = dn · bn + dn−1 · bn−1 + · · · + d1 · b1 + d0 · b0
• Calculate the value of each term and sum them up to get the number in decimal.
To convert a number from the decimal (base 10) system to any other base, follow these steps:
2. Collect Remainders:
3. Reverse Remainders:
• The remainders, read from bottom to top, represent the digits of the number in the
desired base.
to convert a number from one number system to another one may convert to decimal and
then to the desired system.
4
2 Modular Arithmetic
Congruences: If a and b are integers and m is a positive integer, then a is said to be b modulo
m if m | a − b. The congruence is denoted as a ≡ b (mod m). An alternate way to define a
congruence is by saying that if a ≡ b (mod m), then a leaves remainder b when divided by m.
1. a ≡ a (mod n).
Fermat’s Theorem: If p is prime and a is any integer co-prime to p, then ap−1 ≡ 1 (mod p)
5
3 Arithmetic Functions
Arithmetic Function: An arithmetic function, often called as a number-theoretic function,
is a function f : N → C.
The Number of Divisors: The number of divisors of an integer n = pa11 pa22 ...pamm is de-
noted by d(n).
Sum of Divisors: The sum of divisors of n = pa11 pa22 ...pamm (denoted by σ(n)) is given by:
21+1 − 1 171+1 − 1
sol. σ(21 · 171 ) = · = 54.
2−1 17 − 1
Euler’s Totient Function: Euler’s totient function, denoted as φ(n), counts the number
of numbers less than n that are coprime to n.
Illustration: Compute the number of integers less than 36 that are coprime to 36.
Solution: To compute the number of integers less than 36 that are coprime to 36, we use
Euler’s Totient Function, denoted as ϕ(n), which counts the number of integers k such that
1 ≤ k < n and gcd(k, n) = 1.
6
Step 1: Prime Factorization of 36
First, factorize 36:
36 = 22 × 32
Euler’s Totient Function is given by:
1 1 1
ϕ(n) = n 1 − 1− ... 1 −
p1 p2 pk
where p1 , p2 , . . . , pk are the distinct prime factors of n.
Final Answer: There are **ϕ(36) = 12 numbers** less than 36 that are coprime to 36.
12
7
4 Diophantine Equations
Diophantine Equations: A Diophantine equation is a polynomial equation, usually with two
or more unknowns, such that only the integer solutions are of interest.
x = x0 + bt ∀t ∈ Z
y = y0 − at ∀t ∈ Z
ax + by = c
has integer solutions if and only if gcd(a, b) divides c. Here,
• a = 5,
• b = 4,
• c = 20.
Since gcd(5, 4) = 1 and 1 divides 20, the equation has integer solutions.
5x + 4y = 20
Setting x = 0, we solve for y:
4y = 20 =⇒ y = 5
Thus, one particular solution is:
(x0 , y0 ) = (0, 5)
Alternatively, setting y = 0, we solve for x:
5x = 20 =⇒ x = 4
So another particular solution is:
(x0 , y0 ) = (4, 0)
8
Step 3: Find the General Solution
The general solution to a linear Diophantine equation is given by:
x = x0 + bt, y = y0 − at
where t is an integer parameter.
x = 0 + 4t = 4t
y = 5 − 5t
Final Answer:
One may employ a variety of methods to solve the above, they include modular arithmetic,
parity analysis, factorization etc. Graphical Analysis may also be fruitful.
1. a2 = 0, 1 (mod 3)
2. a2 = 0, 1, 4 (mod 8)
3. a2 = 0, 1 (mod 4)
4. a2 = 0, ±1 (mod 5)
5. a3 = 0, ±1 (mod 7)
6. a3 = 0, ±1 (mod 9)
Pythagorean Triplets: Pythagorean triplets are sets of three positive integers (a, b, c) that
satisfy the Pythagorean theorem: a2 + b2 = c2 , where a, b, and c are the lengths of the sides of
a right triangle, with c being the length of the hypotenuse.