0% found this document useful (0 votes)
360 views

Integers and Divisibility

Number theory explores integers and their properties. It includes topics like divisibility, primes, the fundamental theorem of arithmetic, greatest common divisors (GCDs), and least common multiples (LCMs). The document outlines key concepts and algorithms in number theory, including Euclid's algorithm for efficiently finding the GCD of two integers through repeated subtraction rather than factorization.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
360 views

Integers and Divisibility

Number theory explores integers and their properties. It includes topics like divisibility, primes, the fundamental theorem of arithmetic, greatest common divisors (GCDs), and least common multiples (LCMs). The document outlines key concepts and algorithms in number theory, including Euclid's algorithm for efficiently finding the GCD of two integers through repeated subtraction rather than factorization.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

INTEGERS AND

DIVISIBILITY
NUMBER THEORY is a branch of
mathematics that explores integers and their

INTEGERS
properties.
INTEGERS:
• Z integers {…, -2,-1, 0, 1, 2, …}
• Z+ positive integers {1, 2, …

Number theory has many applications within


computer science, including:
• Storage and organization of data
• Encryption
• Error correcting codes
• Random numbers generators
For a,b,c  Z, the following PROPERTIES shall apply:
Closure: a+b Z Commutative Laws: a+b=b+a

INTEGERS
a.b Z a.b=b.a
Associative Laws: a+(b+c)=(a+b)+c
a.(b.c)=(a.b).c
Identity Elements: a+0=0+a=a 0-additive identity
a.1=1.a=a 1-multiplicative identity

Additive Inverse: a+b=b+a=0 The integer b is called additive inverse


of a and is denoted by -a
Distributive Laws: a.(b+c)=a.b+a.c
(b+c).a=b.a+c.a
Cancellation Laws: Suppose that a≠0. Then a.b=a.c implies that b=c
and b.c=c.a implies b=c.
The Fundamental theorem of Arithmetic

INTEGERS
Fundamental theorem of Arithmetic: • Any positive integer
greater than 1 can be expressed as a product of prime numbers.

Examples:
• 12 = 2*2*3
• 21 = 3*

• Process of finding out factors of the product:


factorization.
DIVISION/DIVISIBILITY
Definition: Assume 2 integers a and b, such that a ≠ 0 (a is not

DIVISION
equal 0). We say that a divides b if there is an integer c such that
b = ac. If a divides b we say that a is a factor of b and that b
is multiple of a.
The fact that a divides b is denoted as a | b.
Examples:
• 4 | 24 True or False? True 4is a factor of 24 and 24 is a multiple of 4

• 3 | 7 True or False? False


PRIMES

Definition:A positive integer p that greater than 1 and that

PRIMES
is divisible only by 1 and by itself (p) is called a prime.

Examples:
2, 3, 5, 7, …
1 | 2 and 2 | 2, 1 |3 and 3 | 3, etc
Primes and Composites
How to determine whether the number is a prime or a composite

PRIMES
Let n be a number. Then in order to determine whether it is a prime we can
test:
• Approach 1: if any number x < n divides it. If yes it is a composite. If we
test all numbers x < n and do not find the proper divisor then n is a prime.
• Approach 2: if any prime number x < n divides it. If yes it is a composite. If
we test all primes x < n and do not find a proper divisor then n is a prime.
• Approach 3: if any prime number x < 𝑛 divides it. If yes it is a composite.
If we test all primes x < 𝑛 and do not find a proper divisor then n is a prime.
Division
Let a be an integer and d a positive integer. Then there are unique integers, q
and r, with 0 <= r < d, such that a = dq + r.

DIVISION
Definitions:
• a is called the dividend,
• d is called the divisor,
• q is called the quotient and
• r the remainder of the division.

Relations:
• q = a div d , r = a mod d
GREATEST COMMON DIVISOR

A systematic way to find the gcd using factorization:


• Let a=p1a1 p2a2 p3a3 … pkak and b= p1b1 p2b2 p3b3 … pkbk • gcd(a,b)= p1 min(a1,b1)

GCD
p2 min(a2,b2) p3 min(a3,b3) … pk min(ak,bk)

Examples:
• gcd(24,36) = ?
• 24 = 2*2*2*3=23*3
• 36= 2*2*3*3=22*32
• gcd(24,36) =
LEAST COMMON MULTIPLE

Definition: Let a and b are two positive integers. The least common multiple of
a and b is the smallest positive integer that is divisible by both a and b.

LCM
The least common multiple is denoted as lcm(a,b).

Example:
• What is lcm(12,9) =?
• Give me a common multiple: …
12*9= 108
• Can we find a smaller number?
Yes. Try 36. Both 12 and 9 cleanly divide 36.
LEAST COMMON MULTIPLE

LCM
Example:
• What is lcm(12,9) =?
• 12 = 2*2*3=22*3
• 9=3*3 =32
• lcm(12,9)= 22 * 32 = 4 * 9 = 36
• Factorization can be cumbersome and time consuming since we need to find
all factors of the two integers that can be very large.

ALGORITHM
• Luckily a more efficient method for computing the gcd exists: • It is called

EUCLID
Euclid’s algorithm – the method is known from ancient times and
named after Greek mathematician Euclid.
Eucledian Algorithm for finding the GCD

ALGORITHM
EUCLID
Eucledian Algorithm for finding the GCD

ALGORITHM
EUCLID
Example

ALGORITHM
• Find the GCD of the integers 448 and 196.

EUCLID
• Find the GCD of the integers 675 and 1080.
EUCLID
ALGORITHM
EUCLID
ALGORITHM

You might also like