Select Page

Modular Arithmetic

Modular arithmetic is a system of arithmetic for integers, where numbers “wrap around” upon reaching a certain value called the modulus. The modulus is typically denoted by

. In modular arithmetic, two integers are considered congruent modulo if they have the same remainder when divided by . Here are some key concepts:

  1. Congruence: Two integers

    and
    𝑏

    are said to be congruent modulo 


    if
    𝑎𝑏mod𝑚

    . This is written as 


    .

  2. Addition and Subtraction: In modular arithmetic, addition and subtraction are performed as usual, but the result is reduced modulo

    .

  3. Multiplication: Multiplication in modular arithmetic is performed as usual, but the result is reduced modulo .
  4. Division: Division in modular arithmetic is not straightforward. Instead, it is performed using the multiplicative inverse.
  5. Modular Exponentiation: Calculating

    𝑎𝑏mod𝑚

    efficiently, especially for large values of , is a common operation in modular arithmetic.

Prime Numbers

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In other words, a prime number is a number that cannot be divided evenly by any other number except 1 and itself. Some key properties of prime numbers include:

  1. Primality Test: Determining whether a given number is prime is a fundamental problem in number theory. Several primality tests exist, ranging from simple algorithms to sophisticated probabilistic methods.
  2. Prime Factorization: Every integer greater than 1 can be uniquely expressed as a product of prime numbers, up to the order of the factors. This is known as the fundamental theorem of arithmetic.
  3. Distribution: Prime numbers become less frequent as numbers get larger. However, there are infinitely many prime numbers, as demonstrated by Euclid’s proof.
  4. Applications: Prime numbers are used extensively in cryptography, particularly in public-key cryptography algorithms like RSA, where the security relies on the difficulty of factoring large composite numbers into their prime factors.

Relative Prime Numbers (Coprime Numbers)

Two integers are said to be relatively prime, or coprime, if they share no common positive divisors other than 1. In other words, their greatest common divisor (GCD) is 1. Some key properties of coprime numbers include:

  1. Greatest Common Divisor: The greatest common divisor of two coprime numbers is 1. Conversely, if the GCD of two numbers is 1, then they are coprime.
  2. Applications: Coprime numbers are important in number theory, particularly in the study of modular arithmetic and congruences. They also play a crucial role in RSA encryption, where the public and private keys are generated using coprime numbers.
  3. Infinitely Many: There are infinitely many pairs of coprime numbers. This can be proven by considering pairs of consecutive integers.

Understanding modular arithmetic, prime numbers, and coprime numbers is essential in various areas of mathematics and computer science, including cryptography, number theory, and algorithm design.