Sei sulla pagina 1di 31

17

13
5

19

11

7
23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers

Algebraic Foundations of Computer Science.

The greatest
common divisor

Computational Introduction to Number Theory (I)

Congruences
Eulers totient
function

Ferucio Laurentiu Tiplea

Course readings

Department of Computer Science


AL.I.Cuza University of Iasi
Iasi, Romania
E-mail: fltiplea@mail.dntis.ro
Spring 2014

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

1 / 31

17

13
5

19

11

Outline

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

Divisibility. Prime numbers

The greatest common divisor

Congruences

Eulers totient function

Course readings

Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

2 / 31

17

13
5

19

11

The division theorem

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

The absolute value of an integer a, denoted |a|, is defined by:



a,
if a 0
|a| =
a, otherwise.
Theorem 1 (The Division Theorem)
For any two integers a and b with b 6= 0, there are unique integers
q and r such that a = bq + r and 0 r < |b|.
In the equality a = bq + r in the division theorem, a is called the
dividend, b is called the divisor, q is called the quotient, and r is
called the remainder. We usually write:
q = a div b and r = a mod b

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

3 / 31

17

13
5

19

11

Divisibility relation

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

Definition 2
The binary relation | Z Z given by
a|b (c Z)(b = ac),

Divisibility. Prime
numbers
The greatest
common divisor

for any a, b Z, is called the divisibility relation on Z.

Congruences
Eulers totient
function
Course readings

If a|b then we will say that a divides b, or a is a divisor/factor of b,


or b is divisible by a, or b is a multiple of a.
Remark 1
If a 6= 0, then a|b iff b mod a = 0.
If a|b and a 6 {1, 1, b, b}, then a is called a proper divisor of b.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

4 / 31

17

13
5

19

11

Basic properties of divisibility

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Proposition 1
Let a, b, c Z. Then:
1
0 divides only 0;
2
3

Congruences
4
Eulers totient
function

Course readings
6
7
8
9

a divides 0 and a;
1 divides a;
a|b iff a| b;
if a|b and b|c, then a|c;
if a|b + c and a|b, then a|c;
if a|b, then ac|bc. Conversely, if c 6= 0 and ac|bc, then a|b;
if a|b and a|c, then a|b + c, for any , Z;
if a|b and b 6= 0, then |a| |b|. Moreover, if a is a proper
divisor of b, then 1 < |a| < |b|.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

5 / 31

17

13
5

19

11

Prime numbers

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers

Definition 3
A natural number n 2 is called prime if the only positive factors
of n are 1 and n. A natural number n 2 that is not a prime is
called composite.

The greatest
common divisor

Definition 4

Congruences
Eulers totient
function
Course readings

Let a1 , . . . , am Z, where m 2. We say that a1 , . . . , am are


co-prime or relatively prime, denoted (a1 , . . . , am ) = 1, if the only
common factors of these numbers are 1 and 1.
Example 5
2, 3, 5, 7, and 11 are prime numbers and 4, 6, and 9 are
composite numbers.
(0, 1) = 1 (0 and 1 are co-prime) and (4, 6, 8) 6= 1 (4, 6, and 8
are not co-prime).

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

6 / 31

17

13
5

19

11

Characterization of co-prime numbers

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Theorem 6
Let a1 , . . . , am Z, where m
Then, (a1 , . . . , am ) = 1 iff there
P2.
m
are 1 , . . . , m Z such that i=1 i ai = 1.
Corollary 7

Let a1 , . . . , am , b Z, where m 2. Then:


1
if (b, ai ) = 1, for any i, then (b, a1 am ) = 1;
2
if a1 , . . . , am are pairwise co-prime and ai |b, for any i, then
a1 am |b;
3
if (b, a1 ) = 1 and b|a1 am , then b|a2 am ;
4

if b is prime and b|a1 am , then there exists i such that b|ai .

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

7 / 31

17

13
5

19

11

The fundamental theorem of arithmetic

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

Theorem 8 (The Fundamental Theorem of Arithmetic)


Every natural number n 2 can be written uniquely in the form
n = p1e1 pkek ,

Divisibility. Prime
numbers
The greatest
common divisor
Congruences

where k 1, p1 , . . . , pk are prime numbers written in order of


increasing size, and e1 , . . . , ek > 0.

Eulers totient
function
Course readings

Example 9
4 = 22 , 9 = 32 , 12 = 22 3, 36 = 22 32 .
105 = 3 5 7.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

8 / 31

17

13
5

19

11

The prime number theorem

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Theorem 10
There are infinitely many primes.
Theorem 11 (The Prime Number Theorem)
Let (n) = |{p|p is a prime and p n}|. Then,

Congruences
Eulers totient
function

lim

Course readings

(n)
= 1.
n
ln n

We write
(n)
and say that (n) and
Prof.Dr. F.L. Tiplea (UAIC)

n
ln n

n
are asymptotically equivalent.
ln n

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

9 / 31

17

13
5

19

11

Values of (n)

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

A few values of (n):


n
(n)

101
4

102
25

103
168

104
1229

105
9592

106
78496

107
664579

Divisibility. Prime
numbers
The greatest
common divisor

How many 100-digit primes are there?

Congruences
Eulers totient
function
Course readings

(10100 ) (1099 )

Prof.Dr. F.L. Tiplea (UAIC)

1099
10100

100 ln 10 99 ln 10
!
1099 1
1

ln 10 10 99

>

0.39 1098

4 1097

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

10 / 31

17

13
5

19

11

Large numbers

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function

How large is 1097 ? Below are a few interesting estimates and


comparisons:
the number of cells in the human body is estimated at 1014 ;
the number of neuronal connections in the human brain is
estimated at 1014 ;
the universe is estimated to be 5 1017 seconds old;
the total number of particles in the universe has been
variously estimated at numbers from 1072 up to 1087 .

Course readings

Very large numbers often occur in fields such as mathematics,


cosmology and cryptography. They are particularly important to
cryptography where security of cryptosystems (ciphers) is usually
based on solving problems which require, say, 2128 operations
(which is about what would be required to break the 128-bit SSL
commonly used in web browsers).

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

11 / 31

17

13
5

19

11

The prime spiral

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

There is no known formula for generating prime numbers in a row


which is more efficient than the ancient sieve of Eratosthenes or
the modern sieve of Atkin.
The Ulam spiral (or prime spiral), discovered by Stanislaw Ulam in
1963, is a simple method of graphing the prime numbers.

Congruences

17

13

Eulers totient
function

Course readings

19

11

7
23

The prime numbers tend to line up along diagonal lines !

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

12 / 31

17

13
5

19

11

The greatest common divisor

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers

Definition 12
Let a1 , . . . , am Z, not all zero, where m 2. The greatest
common divisor of these numbers, denoted gcd(a1 , . . . , am ) or
(a1 , . . . , am ), is the largest integer d such that d|ai , for all i.

The greatest
common divisor

Example 13

Congruences
Eulers totient
function

(2, 5, 7) = 1.

Course readings

(9, 3, 15) = 3.
Proposition 2
Let a1 , . . . , am Z, not all zero, where m 2. Then:
1
2
3

(0, a1 , . . . , am ) = (a1 , . . . , am );
(0, a1 ) = |a1 |, provided that a1 6= 0;
(a1 , a2 ) = (a2 , a1 mod a2 ), provided that a2 6= 0.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

13 / 31

17

13
5

19

11

Linear combination of the greatest common divisor

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

Theorem 14
Let a1 , . . . , am Z, not all zero, where m 2. Then,
(a1 , . . . , am ) = 1 a1 + + m am

Divisibility. Prime
numbers
The greatest
common divisor
Congruences

for some 1 , . . . , m Z.
Corollary 15

Eulers totient
function
Course readings

Let a1 , . . . , am Z, not all zero, where m 2. Then, the equation


a1 x1 + + am xm = b
has solutions in Z iff (a1 , . . . , am )|b.
Example 16
2x + 3y = 5 has solutions in Z because (2, 3) = 1 divides 5, but
4x + 2y = 3 does not have solutions in Z because (4, 2) = 2 does
not divide 3.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

14 / 31

17

13
5

19

11

The least common multiple

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Definition 17
Let a1 , . . . , am Z, where m 2. The least common multiple of
these numbers, denoted lcm(a1 , . . . , am ) or [a1 , . . . , am ], is
0, if at least one of these numbers is 0;
the smallest integer b > 0 such that ai |b, for all i, otherwise.

Congruences
Eulers totient
function
Course readings

Example 18
[0, a] = 0, for any a.
[4, 6, 2] = 12.

Theorem 19
Let a, b N, not both zero. Then, ab = (a, b)[a, b].
Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

15 / 31

17

13
5

19

11

The Euclidean algorithm

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers

The Euclidean Algorithm


If a = 0 or b = 0, but not both zero, then (a, b) = max{|a|, |b|}.
Let a > b > 0 and

The greatest
common divisor

r1
r0

rn2
rn1

Congruences
Eulers totient
function
Course readings

=
=

r0 q1 + r1 ,
r1 q2 + r2 ,

0 < r1 < r0
0 < r2 < r1

=
=

rn1 qn + rn ,
rn qn+1 + rn+1 ,

0 < rn < rn1


rn+1 = 0,

where r1 = a s i r0 = b. Then,
(a, b) = (r1 , r0 ) = (r0 , r1 ) = = (rn , 0) = rn

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

16 / 31

17

13
5

19

11

The Euclidean algorithm

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Algorithm 1: Computing gcd


input : a, b Z not both 0;
output: gcd(a, b);
begin
while b 6= 0 do
r := a mod b;
a := b;
b := r
gcd(a, b) := |a|;
Theorem 20 (Lam, 1844)
Let a b > 0 be integers. The number of division steps
performed by Euclid(a, b) does not exceed 5 times the number of
decimal digits in b.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

17 / 31

17

13
5

19

11

The extended Euclidean algorithm

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

The Euclidean algorithm can be easily adapted to compute a


linear combination of the gcd as well. The resulting algorithm is
called the Extended Euclidean Algorithm.
Given a and b there are and such that (a, b) = a + b. The
numbers and can be computed as follows:

Congruences
Eulers totient
function
Course readings

1.
2.
3.
n.
n + 1.

a
b
r1

rn2
rn1

=
=
=

bq1 + r1
r1 q2 + r2
r2 q3 + r3

=
=

rn1 qn + rn
rn qn+1

Va
Vb
Vr1
Vr2
Vr3

=
=
=
=
=

(1, 0)
(0, 1)
Va q1 Vb
Vb q2 Vr1
Vr1 q3 Vr2

Vrn

Vrn2 qn Vrn1

rn = (a, b) and Vrn = (, ).

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

18 / 31

17

13
5

19

11

The extended Euclidean algorithm

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Algorithm 2: Computing gcd and a linear combination of it


input : a, b Z not both 0;
output: gcd(a, b) and V = (, ) s.t. gcd(a, b) = a + b;
begin
V0 := (1, 0);
V1 := (0, 1);
while b 6= 0 do
q := a div b;
r := a mod b;
a := b;
b := r ;
V := V0 ;
V0 := V1 ;
V1 := V qV1
gcd(a, b) := |a|;
V := V0 ;

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

19 / 31

17

13
5

19

11

Linear Diophantine equations

23

Algebraic
Foundations of
Computer Science
(AFCS)

The extended Euclidean algorithm can be used to compute


integer solutions to linear Diophantine equations:

Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Algorithm 3: Computing solutions to linear Diophantine equations


input : a, b, c Z such that not both a and b are 0;
output: integer solution to ax + by = c, if it has;
begin
compute gcd(a, b) := a + b;
if gcd(a, b)|c then
c := c/gcd(a, b);
x := c ;
y := c
else
no integer solutions

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

20 / 31

17

13
5

19

11

Congruences

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea

Definition 21
Let a, b, m Z. We say that a is congruent to b modulo m,
denoted a m b or a b mod m, if m|(a b).

Divisibility. Prime
numbers
The greatest
common divisor

Example 22

Congruences
Eulers totient
function
Course readings

6 0 mod 2.
7 1 mod 2.
3 6 2 mod 2.
11 1 mod 4 and 11 1 mod 4.

Remark 2
If m 6= 0, then a b mod m iff a mod m = b mod m.
Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

21 / 31

17

13
5

19

11

Basic properties of congruences

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Proposition 3
Let a, b, c, d, m, m Z and f : Z Z be a polynomial function
with integer coefficients. Then:
1
m is an equivalence relation on Z;
2

if a m b, then (a, m) = (b, m);

if a m b s i c m d, then a + c m b + d, a c m b d,
ac m bd, and f (a) m f (b);

Congruences
Eulers totient
function
Course readings
4

if ac mc bc and c 6= 0, then a m b;

if ac m bc and d = (m, c), then a m/d b;

if ac m bc and (m, c) = 1, then a m b;

if a mm b, then a m b and a m b;

if a m b and a m b, then a [m,m ] b;

if a m b, a m b, and (m, m ) = 1, then a mm b.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

22 / 31

17

13
5

19

11

Zm

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences

Let Zm be the set of all equivalence classes induced by m . Then:


[a]m = [a]m , for any a Z. Therefore, we may consider only
m 0;
for any a, b Z, if a 6= b then [a]0 6= [b]0 . Therefore, Z0 has as
many elements as Z;
for m 1, Zm = {[0]m , . . . , [m 1]m } has exactly m elements.

Eulers totient
function
Course readings

Example 23
Z1 = {[0]1 }, Z2 = {[0]2 , [1]2 }, Z3 = {[0]3 , [1]3 , [2]3 }.

Remark 3
We usually write Zm = {0, 1, . . . , m 1} instead of
Zm = {[0]m , . . . , [m 1]m }, for any m 1.
Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

23 / 31

17

13
5

19

11

Addition and multiplication modulo m

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Define the following operations on Zm = {0, 1, . . . , m 1}:


a + b = (a + b) mod m;
(binary operation)
a b = (a b) mod m;
(binary operation)
a = (m a) mod m,
for any a, b Zm .

(unary operation)

Congruences

These operations fulfill the following properties:

Eulers totient
function
Course readings

+ and are associative and commutative;


a + 0 = 0 + a = a, for any a;
a 1 = 1 a = a, for any a;
a + (a) = 0, for any a.
a + (b) is usually denoted by a b.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

24 / 31

17

13
5

19

11

Inverses modulo m

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

additive inverse modulo m.


We have seen that a + (a) = 0, for any a. a is called the
additive inverse of a modulo m (it is unique);
multiplicative inverse modulo m.

Congruences
Eulers totient
function
Course readings

Given a Zm {0}, is there any b Zm such that a b = 1?


That is, does any a Zm have a multiplicative inverse modulo
m?
Let us consider m = 6. There is no b Z6 such that 2 b = 1.
Moreover, Z6 exhibits the following interesting property:
23=0
(the product of two non-zero numbers is zero !!!).

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

25 / 31

17

13
5

19

11

Inverses modulo m and the group of units

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences

Proposition 4
a Zm has a multiplicative inverse modulo m iff (a, m) = 1.
The multiplicative inverse of a, when it exists, is unique and it is
denoted by a1 .
Zm = {a Zm |(a, m) = 1} is called the group of units of Zm or the
group of units modulo m.

Eulers totient
function
Course readings

Example 24
Z1 = {0}.
Z26 has 12 elements:
11 = 1, 31 = 9, 51 = 21,
71 = 15, 111 = 19, 171 = 23,
251 = 25.
Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

26 / 31

17

13
5

19

11

Computing multiplicative inverses

23

Algebraic
Foundations of
Computer Science
(AFCS)

The extended Euclidean algorithm can be easily used to compute


multiplicative inverses modulo m:

Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Algorithm 4: Computing multiplicative inverses


input : m 1 and a Zm ;
output: a1 modulo m, if (a, m) = 1;
begin
compute gcd(a, m) := a + m;
if gcd(a, m) = 1 then
a1 := mod m
else
a1 does not exist

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

27 / 31

17

13
5

19

11

Eulers totient function

23

Algebraic
Foundations of
Computer Science
(AFCS)

Eulers totient function is given by:

Prof.Dr. F.L.
Tiplea

(m) = |Zm |,

Divisibility. Prime
numbers

for any m 1. That is, (m) is the number of positive integers less
than or equal to m and co-prime to m.

The greatest
common divisor
Congruences

Theorem 25

Eulers totient
function
Course readings

(1) = 1;

(p) = p 1, for any prime p;

(ab) = (a)(b), for any co-prime integers a, b 1;

(pe ) = pe pe1 , for any prime p and e > 0;

(n) = (p1e1 p1e1 1 ) (pkek pkek 1 ), for any n 1, where


n = p1e1 pkek is the prime decomposition of n.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

28 / 31

17

13
5

19

11

Eulers totient function: examples

23

Algebraic
Foundations of
Computer Science
(AFCS)

Example 26

Prof.Dr. F.L.
Tiplea

(5) = 4.

Divisibility. Prime
numbers

(26) = (2 13) = 12.

The greatest
common divisor

(245) = (5 72 ) = 168.

Congruences
Eulers totient
function
Course readings

Remark 4
it is easy to compute (n) if the prime decomposition of n is
known;
it is hard to compute the prime decomposition of large
numbers (512-bit numbers (about 155 decimals) or larger);
it is hard to compute (n) if n is large and the prime
decomposition of n is not known.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

29 / 31

17

13
5

19

11

Eulers theorem

23

Algebraic
Foundations of
Computer Science
(AFCS)
Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor

Theorem 27 (Eulers Theorem)


Let m 1. Then, a(m) 1 mod m, for any integer a with
(a, m) = 1.
Corollary 28 (Fermats Theorem)

Congruences

Let p be a prime. Then:

Eulers totient
function

1
Course readings
2

ap1 1 mod p, for any integer a with p 6 | a;


ap a mod p, for any integer a.

Example 29
13594 1 mod 5 and 3168 1 mod 245.

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

30 / 31

17

13
5

19

11

Course readings

23

Algebraic
Foundations of
Computer Science
(AFCS)

F.L. Tiplea:

Fundamentele Algebrice ale Informaticii, Ed.


Polirom, Iasi, 2006, pag. 143164.

Prof.Dr. F.L.
Tiplea
Divisibility. Prime
numbers
The greatest
common divisor
Congruences
Eulers totient
function
Course readings

Prof.Dr. F.L. Tiplea (UAIC)

Algebraic Foundations of Computer Science (AFCS)

Spring 2014

31 / 31

Potrebbero piacerti anche