2017 Euclid S Algorithm
2017 Euclid S Algorithm
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
Chapter 1
Euclid’s Algorithm
Introduction to Number Theory Downloaded from www.worldscientific.com
Number theory began as the study of the natural numbers N, the integers
Z and the rational numbers Q, and number theorists were concerned with
questions about how integers factorize, which equations have solutions in
integers, etc. The subject matter of number theory has shifted over the
centuries. During the 19th century, several number theorists, beginning with
Gauss, became interested in other sets of numbers, such as the Gaussian
integers, which are defined as follows:
√
Z[i] = {x + iy : x, y ∈ Z}, where i = −1.
There were two reasons for this shift in interest. First, number theorists
noticed that many of the theorems and methods which they had developed
for solving problems with integers could also be used to solve similar
problems with the Gaussian integers. Secondly, many problems concerning
the integers have a solution which is most easily described using a bigger set
of numbers. The most obvious example of this is the Quadratic Reciprocity
Law which we shall see in a later chapter. This is a theorem about equations
in Z, but its most natural proof uses larger sets of numbers called the
cyclotomic rings.
One thing which all these sets of numbers have in common is that they
are all rings. In this book, the word “ring” will mean what is often called a
“commutative unital ring”, which is defined as follows:
1
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 2
way.
We’ll see several examples of rings in this book. Here are a few familiar
examples.
x≡y mod n.
x̄ = {x + ny : y ∈ Z}.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 3
Euclid’s Algorithm 3
For example, there are three congruency classes modulo 3, and they are
0̄ = {. . . , −6, −3, 0, 3, 6, . . .},
1̄ = {. . . , −5, −2, 1, 4, 7, . . .},
2̄ = {. . . , −4, −1, 2, 5, 8, . . .}.
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
Proof. This is left as Exercise 1.1. (There is a solution at the end of the
book.)
Lemma 1.1 is quite useful for calculations. For example, suppose we’d
like to know the congruency class of 26 × 37 modulo 10. According to the
lemma, this is the same as the congruency class of 6 × 7 modulo 10 because
26 ≡ 6 mod 10 and 37 ≡ 7 mod 10.
The lemma is also used in defining operations of addition and multi-
plication on the set Z/n, which allow us to regard Z/n as a ring. These
operations are defined as follows:
x̄ + ȳ = (x + y),
x̄ × ȳ = (x × y).
For example, in Z/8, we have
33 + 12 = 45 = 5 and 33 × 12 = 396 = 4.
One needs to be a little careful with definitions like this. For example, in
Z/8, we have 33 = 17 and 12 = 20. Therefore, we require 33 × 12 to be the
same congruency class as 17 × 20. However, Lemma 1.1 tells us that this
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 4
is the case. Indeed, in the language of congruency classes, the lemma says
that if x = x and y = y , then x + y = x + y and xy = x y .
To show that Z/n is a ring (with the operations + and × just defined),
one needs to check the Ring Axioms. As an example, we’ll show that the
operation of multiplication on Z/n defined above is associative. For this,
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
we need to check that for all elements x̄, ȳ, z̄ ∈ Z/n, we have
(x̄ × ȳ) × z̄ = x̄ × (ȳ × z̄).
After unwinding the definition of multiplication, this amounts to proving
Introduction to Number Theory Downloaded from www.worldscientific.com
the congruence
(xy)z ≡ x(yz) mod n.
However, the congruence is obviously true: the two sides are actually equal
as integers, so they are certainly congruent modulo n. In fact, each ring
axiom for Z/n can be expressed as a congruence. This congruence is implied
by the corresponding ring axiom for Z, which is the same statement with
the congruence relation replaced by “=”. In this way, we see that the ring
axioms for Z/n are consequences of the ring axioms for Z.
In practice, the notation x̄ for a congruency class is very inconvenient.
It does not tell us the value of n, and it’s a lot of extra work writing a bar
on top of every symbol. Instead, we write the elements of Z/n as integers,
but replace the “=” sign with congruence modulo n. In particular, we’ll
often write Z/n = {0, 1, . . . , n − 1}, when we really mean that the elements
of Z/n are congruency classes.
Example. The elements of Z/5 are the congruency classes of 0, 1, 2, 3
and 4. Addition and multiplication are given by the following tables:
+ 0 1 2 3 4 × 0 1 2 3 4
0 0 1 2 3 4 0 0 0 0 0 0
1 1 2 3 4 0 1 0 1 2 3 4
2 2 3 4 0 1 2 0 2 4 1 3
3 3 4 0 1 2 3 0 3 1 4 2
4 4 0 1 2 3 4 0 4 3 2 1
One can see from the multiplication table that Z/5 is actually a field. This
is because 1 ≡ 0 mod 5, and every element apart from 0 has an inverse for
multiplication:
1 × 1 ≡ 1 mod 5, 2 × 3 ≡ 1 mod 5, 4 × 4 ≡ 1 mod 5.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 5
Euclid’s Algorithm 5
We’ll see in Theorem 1.2 that whenever n is a prime number, the ring Z/n
is a field.
written as
d|m.
If d is a factor of two integers n and m, then we call d a common factor
of n and m. Unless n and m are both zero, they have only finitely many
common factors. There is therefore the highest common factor which is
written hcf(n, m) or sometimes gcd(n, m). We’ll say that n and m are
coprime if their only common factors are 1 and −1, or equivalently if their
highest common factor is 1.
Suppose that n and m are integers with n ≥ m > 0. Dividing n by m
with remainder, we may find integers q and r, such that
n = qm + r, 0 ≤ r < m. (1.1)
The integers q and r are called the quotient and the remainder. All we’re
saying here is that the remainder on dividing an integer by m will always
be less than m. From Equation (1.1), we can see that
Every common factor of m and r is also a factor of n.
Rearranging Equation (1.1), we have r = n − qm, and from this, we can see
that
Every common factor of n and m is also a factor of r.
The last two statements show that the common factors of n and m are
exactly the same as the common factors of m and r. In particular, this
implies
hcf(n, m) = hcf(m, r). (1.2)
As the new numbers m and r are smaller than the original numbers n and
m, we have reduced the problem of calculating hcf(n, m) to the smaller
problem of calculating hcf(m, r). Indeed, as long as r is non-zero, we can
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 6
This shows that hcf(42, 22) = hcf(22, 20). Continuing in this way, we
calculate as follows:
22 = 1 × 20 + 2,
20 = 10 × 2 + 0.
Therefore, hcf(22, 20) = hcf(20, 2) = hcf(2, 0). Since every integer is a
factor of 0, the highest common factor of 2 and 0 is just the largest factor
of 2, which is 2. Putting all this together, we’ve shown that hcf(106, 42) =
hcf(2, 0) = 2.
The algorithm used above for calculating hcf(106, 42) is called Euclid’s
algorithm. Here is a more formal description of the algorithm.
Euclid’s Algorithm.
(1) We begin with two integers n, m and let’s assume that n ≥ m ≥ 0.
(2) Define a finite sequence of integers
r1 ≥ r2 > · · · > rN > rN +1 = 0
recursively as follows: r1 = n, r2 = m, and if rs = 0, then rs+1 is the
remainder on dividing rs−1 by rs .
(3) The highest common factor of n and m is the number rN , i.e. the last
non-zero remainder. To see why this is the case, we use Equation (1.2)
several times:
hcf(n, m) = hcf(r1 , r2 ) = hcf(r2 , r3 ) = · · · = hcf(rN , 0) = rN .
Apart from being useful for calculating the highest common factors, Euclid’s
algorithm also has significant theoretical consequences. This is because it
allows us to prove results concerning highest common factors by induction;
the inductive step uses Equation (1.2). One of the most important examples
of this kind of proof is the following lemma.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 7
Euclid’s Algorithm 7
Lemma 1.2 (Bezout’s Lemma). Let n and m be integers which are not
both 0. Then there exist integers h and k such that
hcf(n, m) = hn + km. (1.3)
finds integers h and k which solve Equation (1.3). This method is just an
extension of Euclid’s algorithm. Suppose we divide n by m with remainder:
n = qm + r, 0 ≤ r < m.
Introduction to Number Theory Downloaded from www.worldscientific.com
Using the top line of the calculation, we can replace the 22 by an expression
in terms of 106 and 42:
2 = 2 × (106 − 2 × 42) − 42.
As before, we can simplify this:
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
2 = 2 × 106 − 5 × 42.
We’ve shown that h = 2, k = −5 is a solution to Equation (1.3). Of course,
this is not the only solution; if we add 42 to h and subtract 106 from k,
Introduction to Number Theory Downloaded from www.worldscientific.com
then we will obtain another solution, so in fact there are always infinitely
many solutions to Equation (1.3).
One can answer questions like Exercise 1.2 using sage. For example,
the command gcd(1349,6035) will give the highest common factor of 1349
and 6035. To find integers h and k satisfying Equation (1.3), we use the
command xgcd(1349,6035). This will return the highest common factor
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 9
Euclid’s Algorithm 9
gcd(1349,6035)
71
xgcd(1349,6035)
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
(71, 9, −2)
9 * 1349 - 2 * 6035
71
Introduction to Number Theory Downloaded from www.worldscientific.com
Exercise 1.3. Let n and m be integers which are not both zero. Show
that an integer a can be written in the form rn + sm with r, s ∈ Z if and
only if a is a multiple of hcf(n, m).
Proposition 1.1. For any ring R, the set R× is a group with the operation
of multiplication.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 10
We’ll now consider which elements of the ring Z/n are invertible.
In other words, given an element x ∈ Z/n, we want a way of finding
out whether there is a y ∈ Z/n such that xy ≡ 1 mod n. To illustrate
this problem, we look at an example. The ring Z/10 has elements
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, and multiplication in this ring is given by the
following table:
× 0 1 2 3 4 5 6 7 8 9
0 0 0 0 0 0 0 0 0 0 0
1 0
1 2 3 4 5 6 7 8 9
2 0 2 4 6 8 0 2 4 6 8
3 0 3 6 9 2 5 8
1 4 7
4 0 4 8 2 6 0 4 8 2 6
5 0 5 0 5 0 5 0 5 0 5
6 0 6 2 8 4 0 6 2 8 5
7 0 7 4
1 8 5 2 9 6 3
8 0 8 6 4 2 0 8 6 4 2
9 0 9 8 7 6 5 4 3 2
1
To find out whether an element x has an inverse, we look along row x to see
if any multiple of x is 1 (in the table, the 1’s are circled). From the table,
we can see that only 1, 3, 7 and 9 have inverses, so (Z/10)× = {1, 3, 7, 9}.
It’s quite time consuming to write out the whole table, just to find out
whether an element has an inverse. The following proposition is a much
quicker way of checking.
Euclid’s Algorithm 11
this form, we simply add 100 to it, which will not change the congruency
class modulo 100. We therefore have
29−1 ≡ 69 mod 100.
Looking at this example, we can see that our method of finding 29−1 is
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
rather fast, when compared with the most naive method where one simply
multiplies all the numbers from 1 to 99 by 29 until one finds a solution to
29x ≡ 1 mod 100.
Exercise 1.6. Find all elements of (Z/12)× and write down a multiplica-
Introduction to Number Theory Downloaded from www.worldscientific.com
Euclid’s Algorithm 13
For example,
1/43 % 120
67
43^-1 % 120
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
67
67
One can also use the command mod(43,120) to define the congruency class
of 43 modulo 120 and then find the inverse of this congruency class.
mod(43,120)^-1
67
We can also define R to be the ring Z/120 and then use R(43) to indicate
the element 43 in the ring Z/120.
R=IntegerModRing(120)
R(43)^-1
67
The third and fourth methods are subtly different from the first and
second methods. This is because the third and fourth methods output the
congruency class of 67 modulo 120, whereas the first two methods output
the integer 67. This difference is apparent if we use the answer in a further
calculation:
2*inverse_mod(43,120)
134
2*R(43)^-1
14
5x ≡ 11 mod 13.
We go through Euclid’s algorithm starting with 13 and 5. As before, we
write the sequence rn from Euclid’s Algorithm in bold.
Introduction to Number Theory Downloaded from www.worldscientific.com
13 = 2 × 5 + 3,
5 = 1 × 3 + 2,
3 = 1 × 2 + 1.
The next remainder would be 0 because our next step would be to divide
by 1. Therefore, the highest common factor of 13 and 5 is 1. This shows
us that 5 is invertible modulo 13, and we continue with our method for
finding the inverse. The next step is to find an expression of the form
1 = h · 13 + k · 5, working backwards through the calculation we’ve just
done.
1=3−2
= 3 − (5 − 3)
=2×3−5
= 2(13 − 2 × 5) − 5
= 2 × 13 − 5 × 5.
Hence, −5 × 5 ≡ 1 mod 13 so 5−1 ≡ −5 mod 13. Now, we can solve the
congruence:
x ≡ −5 × 11 = −55 ≡ 10 mod 13.
We can check that this is indeed a solution: 5 × 10 = 50 ≡ 11 mod 13.
This method will only work if a is coprime to n, since otherwise a would
have no inverse. However, we can still solve the congruence in Equation (1.4)
even when a and n have a common factor. To do this, we use the following
two exercises.
Euclid’s Algorithm 15
Z/n such that a × a−1 ≡ 1 mod n. Then we can multiply both sides of
the congruence by a−1 to get
x ≡ a−1 b mod n.
Introduction to Number Theory Downloaded from www.worldscientific.com
Example.
7x ≡ 84 mod 490.
Note that 7 is a common factor of 84 and 490, so the solution is x ≡
12 mod 70.
Example.
7x ≡ 85 mod 490.
Note that 7 is a factor of 490, but is not a factor of 85, so this congruence
has no solutions.
Example.
6x ≡ 3 mod 21.
This is in neither case 1 nor case 2, since 6 is neither coprime to 21 nor a
factor of 21. However, we can rewrite the congruence as
3(2x) ≡ 3 mod 21.
Using case 2, we deduce that
2x ≡ 1 mod 7.
Now 2 and 7 are coprime, so we use case 1 to get
x ≡ 2−1 ≡ 4 mod 7.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 16
One can solve such congruences in sage using the command solve_mod.
For example, to solve the first congruence in the exercise above, we use the
command
Introduction to Number Theory Downloaded from www.worldscientific.com
solve_mod(4*x==3, 71)
[(54)]
x ≡ a mod n, x ≡ b mod m.
Before proving the theorem, we’ll discuss the general strategy for
proving this kind of result. The theorem states that there is a unique
solution x in Z/nm, and so the proof is in two steps. First, we show that
there is at least one solution; this is called the existence part of the proof.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 17
Euclid’s Algorithm 17
After that, we shall show that any two solutions are actually congruent
modulo nm; this is called the uniqueness part of the proof.
There is another way of thinking about these two steps, which we shall
use here. Recall that for two sets X and Y , the Cartesian product X × Y
is the set of pairs (x, y), where x is an element of X and y is an element
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
of Y . For example,
{1, 3, 4} × {2, 3} = {(1, 2), (1, 3), (3, 2), (3, 3), (4, 2), (4, 3)}.
Proof. (Existence) Since n and m are coprime, we can find integers h and
k such that hn + km = 1. Let x = hnb + kma. We’ll show that x is a
solution to both congruences. From the definition of x, we have
x ≡ kma mod n.
x≡a mod n.
If we look again at the existence part of this proof, then we see that
it actually gives us a formula x = hnb + kma for the solution to the
simultaneous congruences. This allows us to solve these congruences easily
in practice, which is rather more than just knowing that there is a solution.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 18
x ≡ h · 8 · 4 + k · 5 · 3 mod 5 × 8.
We can find the integers h and k as before by Euclid’s algorithm.
8 =5+3 1 =3−2
= 3 − (5 − 3)
Introduction to Number Theory Downloaded from www.worldscientific.com
5 =3+2
3 =2+1 =2×3−5
= 2 × (8 − 5) − 5
= 2 × 8 − 3 × 5.
This shows that we may take h = 2 and k = −3. Hence, the solution is
x ≡ 2 · 8 · 4 − 3 · 5 · 3 ≡ 19 mod 40.
We can easily check that x = 19 is a solution and we have made no mistake,
since 19 ≡ 3 mod 8 and 19 ≡ 4 mod 5. The uniqueness part of the Chinese
Remainder Theorem tells us that there are no other solutions in Z/40.
Remark. The Chinese Remainder Theorem gives us a method for solving
congruences modulo nm by simply solving modulo n and modulo m. For
example, suppose we would like to solve
x2 ≡ 2 mod 119.
We can factorize 119 = 7 × 17, so it’s really enough to find solutions
modulo 7 and modulo 17 and then put the solutions together using the
Chinese Remainder Theorem. The numbers 7 and 17 are small enough that
we can find the solutions by hand:
x ≡ ±3 mod 7, x ≡ ±6 mod 17.
To put the solutions together, we go through Euclid’s algorithm with 7
and 17:
17 = 2 × 7 + 3 1 = 7 − 2 × 3
7 =2×3+1 = 7 − 2(17 − 2 × 7)
= 5 × 7 − 2 × 17.
Hence, the solutions modulo 119 are
x ≡ 5 · 7 · (±6) − 2 · 17 · (±3)
≡ ±28 ± 17 mod 119.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 19
Euclid’s Algorithm 19
The two ± signs may be chosen independently of each other, and so there
are four solutions modulo 119, which are given by
ences:
(a) x ≡ 3 mod 8, x ≡ 4 mod 5,
(b) x ≡ 2 mod 25, x ≡ 1 mod 19.
Introduction to Number Theory Downloaded from www.worldscientific.com
x ≡ a mod n, x ≡ b mod m
Exercise 1.13. Let R and S be rings. Show that the cartesian product
R × S is a ring, with addition and multiplication defined by
(1) 1 ≡ 0 mod p,
(2) Every non-zero element of Fp is invertible.
all integers are made. This is because every positive integer can be written
as a product of primes. Indeed, if n is not itself prime, then it may be
factorized into two smaller numbers; if they are not prime, then they may
both be factorized, etc. This factorizing process cannot continue forever,
since the factors get smaller with each step, so eventually we end up with
a factorization of n into prime numbers. It turns out that this factorization
into prime numbers is unique, even though we may have made many choices
along the way to obtain the factorization.
Theorem 1.3 (Fundamental Theorem of Arithmetic). For every
positive integer n, there is a factorizationa n = p1 · · · pr with prime numbers
p1 , . . . , pr . If we have another factorization n = q1 · · · qs into prime numbers
qi , then r = s and the primes qi may be reordered so that pi = qi for all i.
The two sentences in the Fundamental Theorem of Arithmetic are called
the existence and the uniqueness statements. The existence statement
follows from the discussion above. However, the uniqueness statement is
a little harder, and to prove this part, we shall use the following lemma.
a It is implicit in this notation that when n = 1, we have r = 0, and the empty product
Euclid’s Algorithm 21
Assume that all positive integers less than n factorize into primes. Either n
is prime, in which case, it is a product of exactly one prime, or n = ab with
a and b less than n. By the inductive hypothesis, a and b can be factorized
into primes, and therefore so can n.
(Uniqueness) We’ll prove again by induction on n. The uniqueness
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
statement is clearly true for n = 1. Assume that all positive integers less
than n have a unique factorizaion into primes, and suppose we have two
factorizations of n
n = p1 · · · pr = q1 · · · qs
Introduction to Number Theory Downloaded from www.worldscientific.com
Trial division. It is clear, even from the existence part of the Fundamental
Theorem of Arithmetic, that if n is composite, then the smallest prime
√
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
Exercise 1.17. List the prime numbers up to 30. Hence, use trial division
to determine which of the following numbers are prime and factorize those
which are composite into primes.
263, 323, 329, 540, 617, 851.
We can check using sage that we have the right answer using the
command is_prime:
is_prime(199)
True
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 23
Euclid’s Algorithm 23
We can list all the primes between two numbers with the command
prime_range:
prime_range(100,150)
[101, 103, 107, 109, 113, 127, 131, 137, 139, 149]
by Prajay Thul on 08/09/24. Re-use and distribution is strictly not permitted, except for Open Access articles.
We can also find the factorization of a number into primes using the factor
command.
factor(100)
Introduction to Number Theory Downloaded from www.worldscientific.com
22 · 52
We’ll next consider the question of how many prime numbers there are.
Proof. We’ll prove the theorem by contradiction. Suppose there are only
finitely many primes, and let p1 , . . . , pr be a complete list of all the prime
numbers. Let N = p1 · · · pr + 1. Clearly, N is congruent to 1 modulo every
prime, so in particular, N is not a multiple of any prime number. This
contradicts the Fundamental Theorem of Arithmetic.
There are many variations on the proof of Theorem 1.4 given above,
which show that there are infinitely many prime numbers of a particular
kind. For example, one can show that there are infinitely many prime
numbers congruent to 2 modulo 3. To see this, we shall argue by
contradiction. Suppose for a moment that there were only finitely many
such primes and call these primes p1 , . . . , pr . Consider the prime factors of
the number
N = 3p1 · · · pr − 1.
Exercise 1.18. Prove that there are infinitely many primes which are not
congruent to 1 modulo 5.
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 24
modulo 1477.
Exercise 1.21. Show that there are infinitely many prime numbers p such
that the congruence x5 + x + 1 ≡ 0 mod p has a solution.
Introduction to Number Theory Downloaded from www.worldscientific.com
xn = a + dn, n ∈ N,
and we’d like to know whether the sequence contains infinitely many primes
numbers. It’s clear that hcf(a, d) is a factor of every term xn , and so the
sequence can only contain more than one prime if a and d are coprime.
It turns out that this is the only condition required for such a sequence
to contain infinitely many prime numbers. In other words, we have the
following.
b A proper subgroup of (Z/n)× is a subgroup which does not contain all the elements of
(Z/n)× .
October 31, 2017 14:7 Introduction to Number Theory 9in x 6in b3063-ch01 page 25
Euclid’s Algorithm 25
N
Theorem 1.6 (Prime Number Theorem). π(N ) ∼ log(N ) .
N
1
Li(N ) = dx.
2 log(x)
N
The logarithmic integral is asymptotically equivalent to log(N ) , but |π(N )−
N
Li(N )| is smaller than |π(N ) − log(N ) |. It’s an important open question
to determine just how small π(N ) − Li(N ) is. It is believed that the
following statement is true (which is much stronger than the Prime Number
Theorem).
Conjecture (Riemann Hypothesis). There is a real number B such
that for all N ≥ 2,
√
|π(N ) − Li(N )| ≤ B N log(N ).
The Riemann Hypothesis is usually stated in a different way (see for
example [17]), but the statement above is equivalent.
The prime numbers of the form 2p − 1 are called Mersenne Primes. Not
all numbers of the form 2p − 1 are prime, but it has been conjectured that
there are infinitely many Mersenne Primes.
1.18. N = 5p1 · · · pr − 1.