CS Wiki | Cedric Schwyter

Number Theory

Number Theory

Divisors and Division

πŸ’‘ For integers and we say that divides , denoted , if there exists an integer such that . In this case, is called a divisor of , and is called a multiple of . If and a divisor exists it is called the quotient when is divided by , and we write or . We write if does not divide .

πŸ“– Euclid’s Theorem: For all integers and there exist unique integers and satisfying

Hence is called the dividend, is called the divisor, is called the quotient, and is called the remainder. The remainder is often denoted as or sometimes as .

πŸ’‘ For integers and (not both 0), an integer is called a greatest common divisor of and if divides both and and if every common divisor of and divides , i.e., if

πŸ’‘ For (not both 0) one denotes the unique positive greatest common divisor by and usually calls it the greatest common divisor. If , then and are called relatively prime.

πŸ“Œ For any integers , and , we have

πŸ’‘ The above lemma implies in particular that

which is the basis for Euclid’s well-known -algorithm: Start with and repeatedly replace the pair by the pair until the remainder is 0, at which point the last non-zero number is equal to .

πŸ’‘ For , the ideal generated by and , denoted by , is the set

Similarly, the ideal generated by a single integer is

πŸ“Œ For there exists such that .

πŸ“Œ Let (not both 0). If , then is a greatest common divisor of and .

πŸ“Ž For (not both 0), there exist such that

πŸ’‘ The least common multiple of two positive integers and , denoted , is the common multiple of and which divides every common multiple of and , i.e.,

Factorization into Primes

πŸ’‘ A positive integer is called prime if the only positive divisors of are 1 and . An integer greater than 1 that is not a prime is called composite.

πŸ“– The fundamental theorem of arithmetic: Every positive integer can be writter uniquely (up to the order in which factors are listed) as the product of primes.

πŸ“Œ If is a prime which divides the product of some integers , then divides one of them, i.e., for some .

πŸ’‘ Expressing and : The fundamental theorem of arithmetic assures that integers and can be written as

This product can be understood in two different ways. Either it is over all primes where all but finitely many of the are 0, or it is over a fixed agreed set of primes. Either view is correct. Now we have

and

It is easy to see that

because for all we have

πŸ“– is irrational unless is a square ( for some ).*

Some Basic Facts About Primes

πŸ“– There are infinitely many primes.

πŸ“– Gaps between primes can be arbitrarily large, i.e., for every there exists such that the set contains no prime.

πŸ’‘ The prime counting function is defined as follows: For any real , is the number of primes .

πŸ“– .

❓ Conjecture: There exist infinitely many twin primes, i.e., primes for which also is prime.

❓ Goldbach’s Conjecture: Every even number greater than 2 is the sum of two primes.

πŸ“Œ Every composite integer has a prime divisor .

Congruences and Modular Arithmetic

πŸ’‘ For with , we say that is congruent to modulo if divides . We write or simply , i.e.,

πŸ“Œ For any , is an equivalence relation on .

πŸ’‘

πŸ“Œ If and , then

πŸ“Ž Let be a multi-variate polynomial in variables with integer coefficients, and let . If for , then

πŸ“Œ For any with ,

πŸ“Ž Let be a multi-variate polynomial in variables with integer coefficients, and let . Then

πŸ“Œ The congruence equation

has a solution if and only if . The solution is unique.

πŸ’‘ If , the unique solution to the congruence equation is called the multiplicative inverse of modulo . One also uses the notation or .

πŸ“– The Chinese Remainder Theorem (CRT): Let be pairwise relatively prime integers and let . For every list with for , the system of congruence equations

for has a unique solution satisfying .

πŸ’‘ Useful theorems involving modular arithmetic:

  • For any : .

Application: Diffie-Hellman Key-Agreement

Diffie-Hellman Key-Agreement

This project is maintained by D3PSI