Study Material
Semester-03
DM
Unit-05

Unit 5: Introduction to Number Theory

Introduction to Number Theory

Number theory is a branch of mathematics focused on the study of integers and the relationships between them. It has a rich history and finds applications in cryptography, coding theory, and algorithms. In this unit, we will explore key concepts such as divisibility, greatest common divisor (GCD), Euclidean algorithms, prime factorization, modular arithmetic, and key theorems like Fermat’s Little Theorem, Euler’s Theorem, and the Chinese Remainder Theorem. The primary objective of this unit is to build a strong understanding of integers and their properties through the study of divisibility, primes, and modular arithmetic.


Divisibility of Integers

Properties of Divisibility

Divisibility refers to one integer being divisible by another without leaving a remainder. Formally, for two integers aa and bb, we say that aa divides bb (written as aba | b) if there exists an integer kk such that b=akb = ak. The properties of divisibility include:

  • Reflexive Property: Any integer divides itself, i.e., aaa | a.
  • Transitive Property: If aba | b and bcb | c, then aca | c.
  • Antisymmetric Property: If aba | b and bab | a, then a=±ba = \pm b.

These properties are fundamental in understanding the structure of integers and are used throughout number theory.

Division Algorithm

The division algorithm states that for any two integers aa and bb (with b>0b > 0), there exist unique integers qq and rr such that:

a=bq+r,0r<ba = bq + r, \quad 0 \leq r < b

Here, qq is called the quotient, and rr is the remainder. This is the foundation of many number-theoretic algorithms, including the Euclidean algorithm for finding the greatest common divisor (GCD).


Greatest Common Divisor (GCD) and its Properties

Definition of GCD

The greatest common divisor (GCD) of two integers aa and bb is the largest integer dd that divides both aa and bb. It is denoted as gcd(a,b)\gcd(a, b). For example:

gcd(12,15)=3\gcd(12, 15) = 3

Properties of GCD

  • Commutative Property: gcd(a,b)=gcd(b,a)\gcd(a, b) = \gcd(b, a)
  • Associative Property: gcd(a,gcd(b,c))=gcd(gcd(a,b),c)\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)
  • Distributive Property: gcd(a,bc)=gcd(a,b)gcd(a,c)\gcd(a, bc) = \gcd(a, b) \cdot \gcd(a, c)

The GCD plays a critical role in solving problems related to divisibility, fractions, and modular arithmetic.


Euclidean Algorithm

The Euclidean algorithm is an efficient method for finding the greatest common divisor (GCD) of two integers. It is based on the principle that:

gcd(a,b)=gcd(b,r)\gcd(a, b) = \gcd(b, r)

Where rr is the remainder when aa is divided by bb. The algorithm proceeds by repeatedly applying this rule until the remainder is zero. The last non-zero remainder is the GCD.

Example: To find gcd(252,105)\gcd(252, 105) using the Euclidean algorithm:

  • 252=1052+42252 = 105 \cdot 2 + 42
  • 105=422+21105 = 42 \cdot 2 + 21
  • 42=212+042 = 21 \cdot 2 + 0

Thus, gcd(252,105)=21\gcd(252, 105) = 21.


Extended Euclidean Algorithm

The extended Euclidean algorithm not only computes the GCD of two integers aa and bb but also expresses the GCD as a linear combination of aa and bb. Specifically, it finds integers xx and yy such that:

gcd(a,b)=ax+by\gcd(a, b) = ax + by

This is useful in solving Diophantine equations and finding modular inverses.

Example: For a=252a = 252 and b=105b = 105, the extended Euclidean algorithm gives:

21=252(1)+105321 = 252 \cdot (-1) + 105 \cdot 3

Thus, x=1x = -1 and y=3y = 3.


Prime Factorization Theorem

The prime factorization theorem, also known as the fundamental theorem of arithmetic, states that every integer greater than 1 can be uniquely factored into prime numbers, up to the order of the factors. For example:

60=223560 = 2^2 \cdot 3 \cdot 5

This theorem underpins much of number theory, including the study of divisibility, GCD, and LCM (least common multiple).

Importance of Prime Factorization

Prime numbers are the building blocks of integers, and their unique factorization property is essential in various algorithms, including cryptographic algorithms like RSA.


Congruence Relation

Definition of Congruence

For integers aa, bb, and nn (with n>0n > 0), we say that aa is congruent to bb modulo nn, written as:

ab(modn)a \equiv b \pmod{n}

If nn divides aba - b. In other words, aa and bb leave the same remainder when divided by nn.

Properties of Congruences

  • Reflexive Property: aa(modn)a \equiv a \pmod{n}
  • Symmetric Property: If ab(modn)a \equiv b \pmod{n}, then ba(modn)b \equiv a \pmod{n}
  • Transitive Property: If ab(modn)a \equiv b \pmod{n} and bc(modn)b \equiv c \pmod{n}, then ac(modn)a \equiv c \pmod{n}

Congruence relations are essential in modular arithmetic and number-theoretic algorithms.


Modular Arithmetic

Modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" after reaching a certain value called the modulus. It is often described as "clock arithmetic."

Basic Operations

  • Addition: (a+b)modn(a + b) \mod n
  • Subtraction: (ab)modn(a - b) \mod n
  • Multiplication: (ab)modn(a \cdot b) \mod n
  • Exponentiation: (ak)modn(a^k) \mod n

These operations obey many of the same rules as regular arithmetic but are constrained by the modulus. Modular arithmetic is widely used in cryptography, particularly in algorithms like RSA.


Euler Phi Function

The Euler Phi function ϕ(n)\phi(n) counts the number of integers less than or equal to nn that are relatively prime to nn. If nn is a prime number pp, then:

ϕ(p)=p1\phi(p) = p - 1

For example, ϕ(5)=4\phi(5) = 4, since the numbers 1, 2, 3, and 4 are all relatively prime to 5.

If nn is a product of two distinct primes pp and qq, then:

ϕ(pq)=(p1)(q1)\phi(pq) = (p-1)(q-1)

The Euler Phi function is used in Euler’s Theorem and many other applications in number theory.


Euler’s Theorem

Euler’s Theorem states that if aa is an integer coprime to nn, then:

aϕ(n)1(modn)a^{\phi(n)} \equiv 1 \pmod{n}

This theorem is a generalization of Fermat’s Little Theorem and is crucial in modular arithmetic and cryptography.


Fermat's Little Theorem

Fermat’s Little Theorem states that if pp is a prime number and aa is an integer not divisible by pp, then:

ap11(modp)a^{p-1} \equiv 1 \pmod{p}

This theorem is widely used in number theory, especially in primality testing and cryptographic algorithms.


Additive and Multiplicative Inverses

Additive Inverse

For any integer aa, the additive inverse is the integer that, when added to aa, results in zero. In modular arithmetic, the additive inverse of amodna \mod n is nan - a.

Multiplicative Inverse

The multiplicative inverse of an integer aa modulo nn is an integer xx such that:

ax1(modn)a \cdot x \equiv 1 \pmod{n}

The multiplicative inverse exists if and only if aa and nn are coprime (gcd(a,n)=1\gcd(a, n) = 1).


Chinese Remainder Theorem

The **Chinese Remainder

Theorem** provides a way to solve systems of simultaneous congruences with different moduli. It states that if n1,n2,,nkn_1, n_2, \dots, n_k are pairwise coprime, then the system:

xa1(modn1)x \equiv a_1 \pmod{n_1}
xa2(modn2)x \equiv a_2 \pmod{n_2}
\vdots
xak(modnk)x \equiv a_k \pmod{n_k}

has a unique solution modulo n1n2nkn_1 n_2 \dots n_k.