The Euler Function

Euler Function

Def 1

  • Given a positive integer n ∈ N+, define φ(n) to be the number of integers x ∈ N+, x ≤ n such that gcd(x,n) = 1, i.e., the number of integers that are relatively prime with n.
    • example: When n=5: The integers from 1 to 5 are 1, 2, 3, 4, and 5. All of 1, 2, 3, and 4 are relatively prime to 5, so ϕ(5)=4.
  • in simple terms:
    • relative prime / mutually prime / coprime: when the 2 numbers has
    • Euler’s function: for a given positive int , Euler’s function counts how many numbers from 1 to are relatively prime to

Theorem 2

  • If the prime factorization of n is

Corollary 3

  • for a prime number p, all numbers less than p are relatively prime to p

Theorem 4 (Euler’s Theorem)

  • Given , if a and n are relatively prime, then:

Corollary 5 (Fermat’s Little Theorem)

  • If is a prime and , then
  • If is a prime, for all ,

Corollary 6 & 7

  • If , then is an inverse of
  • If , then is an inverse of

Euler’s Theorem

Definition 8

  • Let
  • Consequently:

Lemma 9

Def 10:

For any element k and subset S of , let define:

Lemma 11

Theorem 4 (Euler’s Theorem)

Primality Test

  • Step 1: pick random , such that , check if and or not
    • No composite number for sure
    • Yes probably a prime, continue with different values of
  • Step 2: compute efficiently for large

Chinese Remainder Theorem

  • is pairwise relatively prime positive int > 1

  • arbitrary integers

  • Then the system

  • has a unique solution modulo (there is a solution x with , and all other solutions are congruent modulo m to this solution)

  • example

    • Let’s take three moduli m1​=3, m2​=4, and m3​=5 that are pairwise relatively prime (i.e., they don’t share any common factor other than 1).
    • Let’s also take three integers a1​=2, a2​=3, and a3​=1.
    • Now, we have the system of congruences:
      • x≡2(mod3)
      • x≡3(mod4)
      • x≡1(mod5)
    • According to the Chinese Remainder Theorem, this system has a unique solution modulo m=m1​m2​m3​=3∗4∗5=60.

    To find the solution, we can use the constructive proof of the Chinese Remainder Theorem:

    1. Compute M=m1​m2​m3​=60.
    2. For each i, compute Mi​=M/mi​=60/mi​ and yi​ such that Mi​yi​≡1(modmi​).
    3. The solution is x=(a1​M1​y1​+a2​M2​y2​+a3​M3​y3​)modM.

    If you do the calculations, you’ll find that the solution is x=23. This means that 23 is the only number between 0 and 59 that gives a remainder of 2 when divided by 3, a remainder of 3 when divided by 4, and a remainder of 1 when divided by 5.

    I hope this example helps illustrate the Chinese Remainder Theorem! Let me know if you have any other questions.