Introduction to NumberTheory in Computing
Number theory is a branch of pure mathematics that deals with the properties
and relationships of numbers, particularly integers.
It focuses on topics like divisibility, prime numbers, modular arithmetic, and
number patterns.
3.
Euler's Theorem
Euler's Theoremstates that for any integer a that is coprime with a positive integer m, the
remainder of aϕ(m)
divided by m is 1.
This relationship arises because when p is a prime number, ϕ(p) equals p-1, thus making
Fermat's Theorem a subset of Euler's Theorem under these conditions.
4.
•Euler's Theorem isa fundamental concept in number theory. It states that if n and
a are coprime positive integers, meaning that they have no mutual proper dividers
other than m = 1, then aϕ(n)
and 1 are relative primes in modulo n.
Euler's Theorem states if a and n are coprime positive integers, then:
aϕ(n)
≡ 1 (mod n)
where,
•ϕ(n) is Euler's totient function, and
•≡ denotes equivalence,
•mod n represents congruence modulo n.
5.
Euler's Totient Function
Formally,for a positive integer n, ϕ(n) is defined as follows:
ϕ(n) = count of integers 1 ≤ a <n such that gcd (a,n)=1
where:
•gcd(a,n) denotes the greatest common divisor of a and n.
•ϕ(n) represents the totient function of n.
6.
Problem: Verify Euler'sTheorem for a = 3 and n = 8.
Solution:
First, we calculate ϕ(8). The numbers less than 8 that are coprime to 8 are 1, 3, 5, and 7.
Thus, ϕ(8)=4.
Next, calculate 34
and find its remainder when divided by 8
34
= 81
Now, find 81 mod 8
81 mod 8 ≡ 1
Thus, 34
≡ 1 (mod 8), which verifies Euler's Theorem.
7.
Proof of Euler'sTheorem
Let φ(n) = k, and let {a1
, . . . , ak
} be a reduced residue system mod n.
For some ai
in {a1
, . . . , ak
}
Since (a, n) = 1, {aa1
, . . . , aak
} is another reduced residue system mod n.
Since this is the same set of numbers mod n as the original system, the two systems must have the
same product mod n:
(aa1
)· · ·(aak
) = a1
· · · ak
(mod n)
⇒ ak
(a1
· · · ak
) = a1
· · · ak (mod n)
Now each ai
is invertible mod n, so multiplying both sides by a1
−1
· · · ak
−1
, We get
ak
= 1 (mod n)
or aφ(n)
= 1 (mod n).
8.
Fermat’s Little Theorem
Fermat’sLittle Theorem States that -
if p is a prime number and a is an integer such that a is not divisible by p, then
ap−1≡1(modp)ap−1≡1(modp).
This means that when ap−1
is divided by p, the remainder is 1.
This also can be written as ap
≡ a (mod p).
For Example -
Let's take p = 7 (a prime number), and a = 3. According to the Fermat's
Little Theorem :
37 1=36 1(mod7)37 1=36 1(mod7)
− ≡ − ≡
9.
Proof of Fermat'sLittle Theorem
Let p be a prime number, and a be an integer such that a is not divisible by p. Consider the set
of numbers formed by multiplying a with integers from 1 to p−1:
S = {a, 2a, 3a, . . . ,(p − 1)a}
Assume that for two numbers i and j such that 1 ≤ i, j < p, the products ia ≡ ja (mod p).
•If ia ≡ ja (mod p), then (i − j)a ≡ 0 (mod p).
•Since p is prime and a is not divisible by p, this implies that p must divide i − j.
•However, 1 ≤ i, j < p means that i − j cannot be divisible by p unless i = j.
Thus, all the products a, 2a, . . . ,(p − 1)a a are distinct modulo p.
The product of all the elements in S is:
a 2a 3a . . . (p − 1)a = a
⋅ ⋅ p−1
[1 2 3 (p−1)] = a
⋅ ⋅ ⋅ ⋯ p−1
(p − 1)! . . . (i)
⋅
10.
Example 1: Findthe remainder when 7100
is divided by 13.
Solution:
Since 13 is a prime number, we can apply Fermat's Little Theorem, which states:
ap−1
≡ 1 (mod p)
where p is a prime number, and a is an integer not divisible by p.
Here, a = 7 and p = 13. By Fermat's Little Theorem:
712
≡ 1 (mod 13)
7100
= 712×8+4
= (712
)8
7
⋅ 4
By Fermat’s Little Theorem:
(712
)8
≡ 18
≡ 1 (mod 13)
Therefore:
7100
≡ 74
(mod 13)ap−1
≡ 1 (mod p)
Now, 72
= 49 49 ÷ 13 = 3 remainder 10
⇒
Thus: 72
≡ 10 (mod 13)ap−1
≡ 1 (mod p)
Now: 74
≡ (72
)2
≡ 102
≡ 100 (mod p)
Again, reducing 100 modulo 13:
100 ÷ 13 = 7 remainder 9
Thus: 74
≡ 9 (mod 13).
Result: Remainder when 7100
is divided by 13 is 9.