0 ratings0% found this document useful (0 votes)

96 views37 pages© Attribution Non-Commercial (BY-NC)

PPT, PDF, TXT or read online from Scribd

Attribution Non-Commercial (BY-NC)

0 ratings0% found this document useful (0 votes)

96 views37 pagesAttribution Non-Commercial (BY-NC)

You are on page 1of 37

Number Theory

c

ntroduction to Number Theory

properties.

divisibility,

greatest common divisors,

least common multiples, and

modular arithmetic

c

ivision

f a and b are integers with a |, we say that

a ëë b if there is an integer c so that b = ac.

of b

and that b is a of a.

(see book for correct symbol).

c

ivisibility Theorems

For integers a, b, and c it is true that

if a | b and a | c, then a | (b + c)

º
V | 6 and V | 9, so V | 15.

º 5 | 1|, so 5 | 2|, 5 | V|, 5 | 4|, «

if a | b and b | c, then a | c

º
4 | 8 and 8 | 24, so 4 | 24.

c

[rimes

A positive integer p greater than 1 is called prime

if the only positive factors of p are 1 and p.

prime is called composite.

Every positive integer can be written as

the

ë

ë

,, where the prime factors

are written in order of increasing size.

c

[rimes

Examples:

15 = V5

48 = 2 2 2 2 V = 24 V

17 = 17

1|| = 2 2 5 5 = 22 52

512 = 2 2 2 2 2 2 2 2 2 = 29

515 = 5 1|V

28 = 227

c

[rimes

divisor less than or equal @ .

must have two prime divisors p1 and p2 such that

p1åp2 = n.

@ , because then p1åp2 > n.

c

The ivision Algorithm

Let be an integer and ë a positive integer.

Then there are unique integers and , with

ë

ë,, such that ë

ë..

ë is called the divisor,

is called the dividend,

is called the quotient, and

is called the remainder.

c

The ivision Algorithm

º

5åV + 2.

17 = 5å

17 is the dividend,

5 is the divisor,

V is called the quotient, and

2 is called the remainder.

c

The ivision Algorithm

r

What happens when we divide -11 by V ?

Note that the remainder cannot be negative.

Vå(-4) + 1.

-11 = Vå

V is the divisor,

-4 is called the quotient, and

1 is called the remainder.

c

Xreatest Common ivisors

Let a and b be integers, not both zero.

The largest integer d such that d | a and d | b is

called the

ë

of a and b.

The greatest common divisor of a and b is denoted

by gcd(a, b).

º
What is gcd(48, 72) ?

The positive common divisors of 48 and 72 are

1, 2, V, 4, 6, 8, 12, 16, and 24, so gcd(48, 72) = 24.

º
What is gcd(19, 72) ?

The only positive common divisor of 19 and 72 is

1, so gcd(19, 72) = 1.

c

Xreatest Common ivisors

o

a = p1a1 p2a2 « pnan , b = p1b1 p2b2 « pnbn ,

where p1 < p2 < « < pn and ai, bi i for 1 i n

º

a = 6| = 22 V1 51

b = 54 = 21 VV 5|

gcd(a, b) = 21 V1 5| = 6

c

Velatively [rime ntegers

Two integers a and b are
if

gcd(a, b) = 1.

º

Are 15 and 28 relatively prime?

Yes, gcd(15, 28) = 1.

Are 55 and 28 relatively prime?

Yes, gcd(55, 28) = 1.

Are V5 and 28 relatively prime?

No, gcd(V5, 28) = 7.

c

Velatively [rime ntegers

The integers a1, a2, «, an are

if gcd(ai, aj) = 1 whenever 1 i < j n.

º

Are 15, 17, and 27 pairwise relatively prime?

No, because gcd(15, 27) = V.

Are 15, 17, and 28 pairwise relatively prime?

Yes, because gcd(15, 17) = 1, gcd(15, 28) = 1 and

gcd(17, 28) = 1.

c

Least Common Multiples

The

of the positive

integers a and b is the smallest positive integer

that is divisible by both a and b.

We denote the least common multiple of a and b

by lcm(a, b).

º

lcm(V, 7) = 21

lcm(4, 6) = 12

lcm(5, 1|) = 1|

c

Least Common Multiples

o

a = p1a1 p2a2 « pnan , b = p1b1 p2b2 « pnbn ,

where p1 < p2 < « < pn and ai, bi i for 1 i n

º

a = 6| = 22 V1 51

b = 54 = 21 VV 5|

4å27

lcm(a, b) = 22 VV 51 = 4å 27åå5 = 54|

c

XC and LCM

a = 6| = 22 V1 51

b = 54 = 21 VV 5|

gcd(a, b) = 21 V1 5| =6

lcm(a, b) = 22 VV 51 = 54|

!

åå ë å

!

c

Modular Arithmetic

Let a be an integer and m be a positive integer.

We denote by

ë the remainder when a is

divided by m.

º

9 mod 4 = 1

9 mod V = |

9 mod 1| = 9

-1V mod 4 = V

c

Congruences

Let a and b be integers and m be a positive integer.

We say that

ë

if

m divides a ² b.

00

ë to indicate

that a is congruent to b modulo m.

n other words:

a 0 b (mod m) if and only if

ë

ë.

ë

ë.

c

Congruences

º

s it true that 46 0 68 (mod 11) ?

Yes, because 11 | (46 ² 68).

s it true that 46 0 68 (mod 22)?

Yes, because 22 | (46 ² 68).

For which integers z is it true that z 0 12 (mod 1|)?

z{«,

t is true for any z {«,--28, -18, -8, 2, 12, 22, V2, «}

!

Let m be a positive integer. The integers

a and b are congruent modulo m if and only if there

is an integer k such that a = b + km.

c

Congruences

!

Let m be a positive integer.

f a 0 b (mod m) and c 0 d (mod m), then

a + c 0 b + d (mod m) and ac 0 bd (mod m).

[

We know that a 0 b (mod m) and c 0 d (mod m)

implies that there are integers s and t with

b = a + sm and d = c + tm.

Therefore,

b + d = (a + sm) + (c + tm) = (a + c) + m(s + t) and

bd = (a + sm)(c + tm) = ac + m(at + cs + stm).

Hence, a + c 0 b + d (mod m) and ac 0 bd (mod m).

c

The Euclidean Algorithm

The º
ë r

finds the

ë

of two integers a and b.

For example, if we want to find gcd(287, 91), we

ëë 287 by 91:

91åV + 14

287 = 91å

We know that for integers a, b and c,

if a | b and a | c, then a | (b + c).

Therefore, any divisor of 287 and 91 must also be

a divisor of 287 - 9191ååV = 14.

Consequently, gcd(287, 91) = gcd(14, 91).

c

The Euclidean Algorithm

n the next step, we divide 91 by 14:

14å6 + 7

91 = 14å

This means that gcd(14, 91) = gcd(14, 7).

So we divide 14 by 7:

7å 2 + |

14 = 7å

We find that 7 | 14, and thus gcd(14, 7) = 7.

!

ë!"# "$

c

The Euclidean Algorithm

n ë

ë

ë

ë,, the algorithm can be implemented

as follows:

ë gcd(a, b: positive integers)

x := a

y := b

y |

r := x

ë y

x := y

y := r

ë {x is gcd(a, b)}

c

Vepresentations of ntegers

Let b be a positive integer greater than 1.

Then if n is a positive integer, it can be expressed

in the form:

a|, a1, «, ak are nonnegative integers less than b,

and ak |.

º

8å1|2 + 5å

859 = 8å 5å1|1 + 9å

9å1||

c

Vepresentations of ntegers

º

1å24 + 1å

(1|11|)2 = 1å 1å22 + 1å

1å21 = (22)1|

º

% ë

(we use letters A to F to indicate numbers 1| to 15)

Vå16V + 1|å

(VA|F)16 = Vå 1|å162 + 15å

15å16| = (1486V)1|

c

Vepresentations of ntegers

How can we construct the base b expansion of an

integer n?

First, divide n by b to obtain a quotient q| and

remainder a|, that is,

n = bq| + a|, where | a| < b.

The remainder a| is the rightmost digit in the base

b expansion of n.

Next, divide q| by b to obtain:

q| = bq1 + a1, where | a1 < b.

a1 is the second digit from the right in the base b

expansion of n. Continue this process until you

obtain a quotient equal to zero.

c

Vepresentations of ntegers

º

What is the base 8 expansion of (12V45)1| ?

8å154V + 1

12V45 = 8å

8å192 + 7

154V = 8å

8å24 + |

192 = 8å

8å V + |

24 = 8å

8å| + V

V = 8å

The result is: (12V45)1| = (V||71)8.

c

Vepresentations of ntegers

ëbase_b_expansion(n, b: positive integers)

ëbase_b_expansion(n,

q := n

k := |

q |

ak := q mod b

q := q/b

k := k + 1

ë

{the base b expansion of n is (ak-1 « a1a|)b }

c

Addition of ntegers

Let a = (an-1an-2«a1a|)2, b = (bn-1bn-2«b1b|)2.

How can we add these two binary numbers?

First, add their rightmost bits:

a| + b| = c|å2 + s|,

where s| is the

in the binary

expansion of a + b, and c| is the

..

Then, add the next pair of bits and the carry:

a1 + b1 + c| = c1å2 + s1,

where s1 is the in the binary expansion of

a + b, and c1 is the carry.

c

Addition of ntegers

a + b = (snsn-1«s1s|)2

c

Addition of ntegers

º

Add a = (111|)2 and b = (1|11)2.

a| + b| = | + 1 = |

1å2 + |, so c1 = 1 and s1 = |.

a1 + b1 + c| = 1 + 1 + | = 1å

1å2 + |, so c2 = 1 and s2 = |.

a2 + b2 + c1 = 1 + | + 1 = 1å

1å2 + 1, so cV = 1 and sV = 1.

aV + bV + c2 = 1 + 1 + 1 = 1å

s4 = cV = 1.

Therefore, s = a + b = (11||1)2.

c

Addition of ntegers

How do we (humans) add two integers?

1 11 carry

Example: 758V

+ 49V2

1 25 1 5

1 1 carry

Binary expansions: (1|11)2

+ (1|1|)2

(1|1 |1 )2

c

Addition of ntegers

Let a = (an-1an-2«a1a|)2, b = (bn-1bn-2«b1b|)2.

How can we

add

add these two binary

numbers?

First, add their rightmost bits:

a| + b| = c|å2 + s|,

where s| is the

in the binary

expansion of a + b, and c| is the

..

Then, add the next pair of bits and the carry:

a1 + b1 + c| = c1å2 + s1,

where s1 is the in the binary expansion of

a + b, and c1 is the carry.

c

Addition of ntegers

a + b = (snsn-1«s1s|)2

c

Addition of ntegers

º

Add a = (111|)2 and b = (1|11)2.

a| + b| = | + 1 = |

1å2 + |, so c1 = 1 and s1 = |.

a1 + b1 + c| = 1 + 1 + | = 1å

1å2 + |, so c2 = 1 and s2 = |.

a2 + b2 + c1 = 1 + | + 1 = 1å

1å2 + 1, so cV = 1 and sV = 1.

aV + bV + c2 = 1 + 1 + 1 = 1å

s4 = cV = 1.

Therefore, s = a + b = (11||1)2.

c

Addition of ntegers

ëadd(a, b: positive integers)

ëadd(a,

c := |

for j := | to n-n-1

begin

d := (aj + bj + c)/2

sj := aj + bj + c ² 2d

c := d

end

sn := c

{the binary expansion of the sum is (snsn-1«s1s|)2}

c

Skip section### Trending

- The Duke's Shotgun WeddingStacy Reid
- Fallen Too Far: A Rosemary Beach NovelAbbi Glines
- CrankEllen Hopkins
- Crush It!: Why Now Is the Time to Cash in on Your PassionGary Vaynerchuk
- Cinder: Book One of the Lunar ChroniclesMarissa Meyer
- Manifest Your DestinyWayne W. Dyer
- Good to Great: Why Some Companies Make the Leap...And Others Don'tJim Collins
- Rich Dad Poor Dad: What The Rich Teach Their Kids About Money - That the Poor and Middle Class Do Not!Robert T. Kiyosaki
- Penguins, Penguins, Everywhere!Bob Barner
- Constellations: A PlayNick Payne
- Red QueenVictoria Aveyard
- Brown Bear, Brown Bear, What Do You See?Bill Martin, Jr.
- Panda Bear, Panda Bear, What Do You See?Bill Martin, Jr.
- Little House in the Big WoodsLaura Ingalls Wilder
- KindredOctavia E. Butler
- On the Banks of Plum CreekLaura Ingalls Wilder
- Until It Fades: A NovelK.A. Tucker
- Exploit Loophole 609 to Boost Your Credit Score and Remove All Negative Items From Your Credit ReportRobert Pemberton
- They Both Die at the EndAdam Silvera
- Spy School Secret ServiceStuart Gibbs
- Convenience Store Woman: A NovelSayaka Murata
- Butterface (A Hot Romantic Comedy)Avery Flynn
- The Worst Best Man: A NovelMia Sosa
- Disloyal: A Memoir: The True Story of the Former Personal Attorney to President Donald J. TrumpMichael Cohen