goldbach conjecture report

48
The Theory Behind the Goldbach Conjecture and Similar Problems, Including Verification of Goldbach for Small Numbers ECM3735 — Mathematics Group Project December 5, 2013 016765, 005002, 024151, 013426, 003300, 008850, 019759, 031798 Project Advisor: Gihan Marasingha 1

Upload: alexander-spong

Post on 11-Aug-2015

67 views

Category:

Documents


10 download

TRANSCRIPT

Page 1: Goldbach Conjecture Report

The Theory Behind the Goldbach Conjecture and Similar

Problems, Including Verification of Goldbach for Small Numbers

ECM3735 — Mathematics Group Project

December 5, 2013

016765, 005002, 024151, 013426, 003300, 008850, 019759, 031798Project Advisor: Gihan Marasingha

1

Page 2: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 2

Contents

1 Introduction 31.1 History of the Goldbach Conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Basic Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2.1 Partition Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2.2 Waring’s Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.3 Hardy-Littlewood Circle Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.3.1 Generalised Additive Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3.2 Dissecting the Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.4 Sieve Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.4.1 Sieve of Eratosthenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.4.2 Goldbach Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.5 Limitations of Theoretical Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121.6 Primality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.7 Computing for Primes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2 Methodology 14

3 Findings 173.1 Naı̈ve Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1.1 1st Naı̈ve Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.1.2 2nd Naı̈ve Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.2 Sieves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.1 Sieve of Eratosthenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.2 Goldbach Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.3 Primality Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.3.1 Fermat’s Primality Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.3.2 The Miller-Rabin Primality Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.3.3 AKS Primality Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.4 Comparison of Primality Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.4.1 The Two Probabilistic Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.4.2 Comparison of All Three Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.5 Test’s Theoretical and Experimental Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.5.1 Fermat’s Primality Test Order of Complexity . . . . . . . . . . . . . . . . . . . . . . . . . 333.5.2 Miller-Rabin’s Primality Test Order of Complexity . . . . . . . . . . . . . . . . . . . . . . 343.5.3 The AKS Primality Test Order of Complexity . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.6 Prime Ladders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4 Conclusion 364.1 Conclusions on Primality Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.2 Conclusions on Sieves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.3 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.3.1 Evaluation of Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.3.2 Evaluation of Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.3.3 Evaluation of Group performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

4.4 Future Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5 Appendices 41

Page 3: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 3

1 Introduction

1.1 History of the Goldbach Conjecture

The Goldbach Conjecture is an old and famous problem in the field of number theory. It was first discussedin 1742 between Christian Goldbach and Leonhard Euler; the problem has remained unsolved since then, andalthough unsolved the 271-year-old problem has had significant breakthroughs over the past century. Theproblem is so well known it is often used in culture such as TV shows, films and novels. From March 20th 2000to March 20th 2002, Faber and Faber, an independent UK based publishing house, offered a prize of £1,000,000to anyone who could solve the problem. The Goldbach conjecture has 2 forms, the “Strong Conjecture” andthe “Weak Conjecture”. The Strong Goldbach conjecture states [24]:

Conjecture 1. All even integers greater than 2 can be expressed as a sum of 2 primes i.e. p1 + p2 = 2n forp1, p2 ∈ P and n ∈ N such that n > 2

Whereas the Weak Goldbach Conjecture states;

Conjecture 2. All odd integers greater than 5 can be expressed as a sum of 3 primes i.e. p1 + p2 + p3 = 2n+ 1for p1, p2, p3 ∈ P and n ∈ N such that n > 2

Since their discovery the problems have been extensively researched into and over the past century mathe-maticians have progressively come closer to proving the conjecture. In the early 1900’s mathematicians GodfreyHardy and Srinivasa Ramanujan developed a technique called the circle method in 1916 and 1917, althoughit was fully developed by Hardy and John Littlewood, hence its more commonly known name “The Hardy-Littlewood Circle Method”. This method is used for a number of problems in analytical number theory. Itdeals with finding the asymptotic nature of a specific series. For the Goldbach conjecture, this method isnot used to find whether a number can be summed from two primes, but rather the number of ways thischosen number can be made of two primes. For example, 14 can be made of 2 primes in 2 different ways, as14 = 11+3 = 7+7. One can then use this technique to show that all numbers have at least 1 way of being madeup as a sum of 2 primes. This process is exactly what Russian mathematician Ivan Matveyevich Vinogradovdid in 1937 but instead he showed that every sufficiently large odd number is the sum of 3 primes. Which givesus Vinogradov’s three prime theorem [3]:

Theorem 1. Every sufficiently large odd number is a sum of three primes

This however does not prove Conjecture 2 as Vinogradov’s theorem is only true for ‘sufficiently’ largeodd numbers, however it still provided a strong basis for future work in solving both the strong and weakGoldbach conjecture. The ‘sufficiently’ large number for which Vinogradov’s theorem holds is approximately3.25 × 106846168 [24]. However this result was reduced by Chen and Wang in 1989 to 3.33 × 1043000 [24].Chen himself made large contributions to closely related problems to the Goldbach conjecture. Chen’s methodinvolved using a sieve which helps count primes in a specified set, this method can be used as well as theHardy-Littlewood method although it is not the preferred method of analysing the conjecture. We will discusshow sieve methods can be used and implemented in the Goldbach conjecture and similar problems in a sievesection of the findings.

Over the years there have been claimed proofs of the Strong Goldbach conjecture, which would consequentlyprove the weak conjecture. However all of these proofs have not been accepted by the Mathematics community.The most notable failed attempt to solve the problem was written by H.A. Pogorzelski in 1977 [6], howeverthis was not a completely valid proof and hence the conjecture remains unsolved. Many attempts have reliedupon logical fallacies or unreasonable assumptions as a crux for their proposed proof. One notable example ofthis is a proof formulated by Miles Mathis [13]. Mathis’ proof, by his own admission, does not follow many ofthe conventions expected of mathematical proofs, and his key failing is that he assumes that the proportionof primes over any particular interval can be assumed to be 1

n , with ‘n’ being some unknown integer. This isfallacious, as the proportion of primes converges to zero as ‘n’ tends to infinity, it is not possible to take a setproportion of primes in a given range of numbers and then extrapolate that for all numbers, as Mathis does,and have the proof be mathematically valid. Thus, this proof, and any proof which follows a similar vein, isultimately erroneous.

The most notable attempt to solve the problem was written by H.A. Pogorzelski in 1977 [6]. Unlike Mathis,Pogorzelski maintains a strictly rigorous mathematical approach throughout, and his proof is, in theory, logi-cally sound. However, the prerequisites that he details at the beginning, which his proof relies on, depend uponseveral other unproven theorems and conjectures being true including the consistency hypothesis, the extendedWittgenstein Thesis and Church’s Thesis all mentioned in his paper [6] − thus, the conjecture is only proventrue if the unproven assumptions made by Pogorzelski are also true. Subsequently, his proof is usually not

Page 4: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 4

accepted as valid either, because while his logic is not provably false, the theorems he utilises must be provenbefore his proof can be considered mathematically valid.

The most recent papers regarding research into proof of the conjecture were submitted as recently as 2013by Peruvian mathematician Harald Helfgott [7], who claims to have proved the weak Goldbach conjecture.Although his research papers are still being evaluated by the mathematical community, it is widely believed tobe a valid proof of the weak conjecture.

However despite all the attempted proofs of the strong conjecture, it has remained unsolved. We are goingto discuss the main technique used for solving a problem of the Goldbach conjecture’s nature which is theHardy-Littlewood circle method. This, as mentioned beforehand, was the same method Vinogradov used inproving the three prime theorem. We will go through the very basic forms of additive problems and form an ideaof how the Hardy-Littlewood circle method was conceived, how the method works and what type of problemsin number theory it is used for.

1.2 Basic Theory

The Hardy-Littlewood method helps solve and understand the additive nature of numbers and seeks answers toquestions such as how many ways can a number be represented as a sum of kth powers and how many numberscan be represented as a summation of primes. To delve into these deeper questions we must first understandsome of the most basic forms of these questions. Let’s first investigate the most basic form of an additiveproblem, by taking the equation x1 + x2 + ... + xs = n for s, n ∈ N such that 1 ≤ s ≤ n. This problem canbe solved in a number of ways, but the easiest way is to show it combinatorically by the help of the diagrambelow. We can set the problem up as the following grid, with each horizontal line representing the variablesx1, x2, ..., xs and the vertical lines representing each value that variable takes. For example in the equationbelow we have the grid representation and the solution [22]:

x1 + x2 + x3 + x4 + x5 + x6 + x7 = 8 can be represented as the following grid:

Figure 1 - Grid Representation of x1 + x2 + x3 + x4 + x5 + x6 + x7 = 8

The red lines on the grid represent the following solution x1 = 1, x2 = 2, x3 = 0, x4 = 1, x5 = 1, x6 = 1, x7 =2, as each horizontal ‘step’ represents the value of the variable which is represented by the vertical ‘steps’. Onecould ask how many solutions or ‘paths’ are there for this equation using this grid method? This is easy tocalculate combinatorically [22].

Page 5: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 5

Proof 1. Consider the following equation x1 + x2 + ... + xs = n for s, n ∈ N such that 1 ≤ s ≤ n. Let us setup the following grid:

Figure 2 - Grid Representation of x1 + x2 + ...+ xs = n

Let U = the number of vertical steps on the grid. Let H = the number of horizontal steps on the grid. It is clearfrom the grid that there can only be n amount of H ‘steps’ and only s − 1 amount of U ‘steps’. Therefore wehave the following:

U = s− 1H = n

Let P = the total number of both H and U steps. It is clear that P = U + H and hence:

P = n+ s− 1

Now we have a very simple problem. We can now re-phrase the original problem as. How many distinctways are there of writing n+ s− 1 elements with n amount of one element and s− 1 amount of the other? Tosolve this first think of how many different ways are there or arranging n + s − 1 elements? This is obviously(n + s − 1)!, however as we are looking for distinct solutions we also must ignore when the arrangements arethe same. Hence we get the following solution:

Total Solutions to the equation (x1 + x2 + ...+ xs = n) = (n+s−1)!n!(s−1)! =

(n+s−1n

)=(n+s−1s−1

)We can also solve this in a more elegant and useful way. We can also use generating functions to solve the

above problem. Let the following generating function be the solution to the equation x1 +x2 + ...+xs = n, thatis to say the coefficients of the power series formed by the generating function follow the solutions for changingvalues of s:

Equation 1. f(t) =∑∞

0 tx = 11−t

For all values of xi for i ∈ [1, s] we will have s amount of f(t) for each xi i.e:

f(t)s =∑∞x1=0 t

x1∑∞x2=0 t

x2 ...∑∞xs=0 t

xs

f(t)s =∑∞

0 tx1+x2+...+xs

This will give us the following equation for the generating function.

Equation 2. f(t)s =∑∞n=0 rs(n)tn (As x1 + x2 + ...+ xs = n)

Here rs(n) is the number of ways to write n as a sum of s non-negative integers. We can find the solutionanalytically and this is the same method used in the Hardy-Littlewood Circle Method. The problem withsolving an equation of this nature like this is that it doesn’t give a true interpretation of the partitioning of anumber. A partition is a representation of a non-negative integer as a sum of non-negative integers. So whentrying to find a partition of a number we are looking for solutions to x1 + x2 + ... + xs = n. This is the sameproblem as we have looked at beforehand, however solving combinatorically as we did beforehand can give the

Page 6: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 6

same partition. For example if we are trying to solve the equation x1 + x2 + x3 = 3 we can have the solutionx1 = 1, x2 = 0, x3 = 2 as 1 + 0 + 2 = 3 and we can also have the solution x1 = 2, x2 = 1, x3 = 0 as 2 + 1 + 0 = 3.If we solved the equation using the grid method, these 2 solutions would be unique. However when we arelooking for the partitions, these 2 solutions are counted as the same partition as 1 + 0 + 2 = 2 + 1 + 0 = 3.Hardy and Ramanujan [2] were particularly interested in these partitions of numbers and looking at how manya chosen number has, they used their circle method to study and find the asymptotic nature of the number ofpartitions for some number.

1.2.1 Partition Number

For looking at the partition of the number we must take a different approach to the problem beforehand, wecan see that the grid method we used before, has its limitations and becomes of little use to us in this sort ofquestion. First let us define what a partition of a number is. A partition of a integer n is the way of writing nas a sum of positive integers. Now let P (n) = Total number of partitions of n, for some n ∈ N. First lets takea look at small values of n:

P (0) = 1 as 0 = 0

P (1) = 1 as 1 = 1

P (2) = 2 as 2 = 2 = 1 + 1

P (3) = 3 as 3 = 3 = 2 + 1 = 1 + 1 + 1

P (4) = 5 as 4 = 4 = 3 + 1 = 2 + 2 = 2 + 1 + 1 = 1 + 1 + 1 + 1

The pattern for small numbers seems to be following the Fibonacci, so we can expect P(5) = 8. Howeverwe can see that:

5 = 5 = 4 + 1 = 3 + 2 = 3 + 1 + 1 = 2 + 2 + 1 = 2 + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1 and therefore;

P (5) = 7

So the pattern is not following an obvious recognisable pattern. To inspect the pattern it is following wemust use a generating function. This can give us a recurrence relation between the partition numbers and hencefind an equation. Let the generating function P(t) be the generating function for the partition number P(n):

P (t) =∑∞n=0 P (n)tn

Before we start solving the above generating function using more conventional methods, let’s first examinethe partitioning problem again. We are looking for the number of ways a number can be made up as a sum ofintegers less than or equal to that number. So for n = 3, 3 can only be written as a sum of the integers 1, 2and 3 itself. Extending this to n we know that it can only be made of the numbers in the interval [1, n]. Let’srewrite the problem as the following equation:

1a1 + 2a2 + 3a3 + ...+ nan = n where ai = Number of the integer i in the partition with i ∈ [1, n]

We can write the generating function for P(n) now as the following:

P (t) =∑∞a1=0

∑∞a2=0

∑∞a3=0 ...

∑∞an=0 t

1a1+2a2+3a3+...+nan

This is due to similar reasoning as the generating function used previously:

P (t) =∑∞a1=0

∑∞a2=0

∑∞a3=0 ...

∑∞an=0 t

1a1+2a2+3a3+...+nan

P (t) =∑∞a1=0 t

a1∑∞a2=0 t

2a2∑∞a3=0 t

3a3 ...∑∞an=0 t

nan

P (t) = 11−t

11−t2

11−t3 ...

11−tn

Page 7: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 7

P (t) =∏∞k=1

11−tk

Euler himself investigated this generating function to try to find an explicit formula for the partitioningfunction. Despite no formula being found he did find a recurrence relation for the partitions of a given numbern. Instead of investigating the given P(t) above Euler investigated it’s inverse as it’s product is easier to calculate:

Theorem 2. Let Q(t) = 1P (t) =

∏∞n=1(1− tn) by expanding out we get:

Q(t) = (1− t)(1− t2)(1− t3)(1− t4)(1− t5)...

Q(t) = (1− t− t2 + t3)(1− t3)(1− t4)(1− t5)...

Q(t) = (1− t− t2 + t3 − t3 + t4 + t5 + t6)(1− t4)(1− t5)...

Q(t) = (1− t− t2 + t4 + t5 − t6)(1− t4)(1− t5)...

Q(t) = (1− t− t2 + t4 + t5 + t6 − t4 + t5 − t6 − t8 − t9 + t10)(1− t5)...

Q(t) = (1− t− t2 + 2t5 − t8 − t9 + t10)(1− t5)...

Continuing this we get the following; Q(t) = 1−t−t2+t5+t7+ ... Euler noticed that the powers of this powerseries follow the generalized pentagonal numbers with the coefficients either 1 or -1. The generalized pentagonal

numbers are given by m(3m±1)2 for m ∈ N. Euler concluded that the Q(t) could be given by the following formula,

giving light to “Euler’s Pentagonal Number Formula” [5]:

Q(t) =∏∞k=1(1− tk) =

∑∞k=−∞(−1)k(t

m(3m−1)2 ) = 1 +

∑∞k=1(−1)k(t

k(3k+1)2 + t

k(kn−1)2 )

We know that P(t) and Q(t) are the inverse of each other we can conclude that Q(t)P (t) = 1. Hence allcoefficients for tk = 0 for all k ≥ 1

∑n0 qkpn−k where qk = tn coefficient of Q(t)

Since q0 = 0 we get pn = −∑n

1 qkpn−k

We also have that qk vanishes for k ≥ 1 unless k = m(3m±1)2 in which case qk = (−1)m and therefore we get

the following summation:

pn = −∑n

1 (−1)m[pn−m(3m−1)

2

+ pn−m(3m+1)

2

]

We then get the final recurrence relation for the partition numbers:

pn = pn−1 + pn−2 − pn−5 − pn−7 + pn−12 + ...

This partitioning of numbers can be used for similar problems. In particular for Waring’s problem whichstates that:

Theorem 3. For every positive natural number k there exists an integer s such that every natural number canbe represented as a sum of s kth power i.e. n = xk1 + xk2 + ...+ xks

By the same argument we can find the the generating function for the partitioning of numbers into kth

powers. As before we follow the same steps to find the generating function for partition function. Howeverinstead of finding a solution to the partition 1a1 + 2a2 + 3a3 + ... + nan = n we must find a solution to1ak1 + 2ak2 + 3ak3 + ...+ nakn = n. Using the same method as before we get the generating function:

P (t) =∏∞n=1

1

1−tnk

Page 8: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 8

These products despite providing a useful insight to the nature of partitioning a number into natural num-bers or into kth powers they do not provide an explicit formula for the problem we are intending to solve.As is shown above where we only achieved a recurrence relation from the Euler’s pentagonal number formula.The explicit formula must be derived as beforehand, and then find the coefficient of the power series of thegenerating function. The generating functions for partitioning numbers were looked at extensively by Hardyand Ramanujan. They devised their circle method to look at the partitioning of numbers and the same methodhas been used to solve general additive problems such as Waring’s problem and have been used to researchinto Goldbach’s Conjecture. The Circle method originally derived by Hardy and Ramanujan but finalised byHardy and Littlewood did not help find an explicit formula for the partition function however the circle methodexamines the asymptotic nature as n increases. Hardy and Ramanujan used this method and managed to findan asymptotic expression for the partitioning function P(n), they found it to be asymptotic to the function [20]:

Equation 3. P (n) ∼ eπ

√2n3

4n√3

1.2.2 Waring’s Problem

As mentioned beforehand in Theorem 5 Waring’s problem asks the question as whether every natural numbercan be represented as a sum of s amount of kth powers. This original problem was first proposed by Englishmathematician Edward Waring in 1770 [16]. He originally looked for the smallest number s amount of kth powersneeded to represent all natural numbers n. This lower bound for the number of kth powers needed is denoted by:

Equation 4. g(k) ≥ s where g(k) is the smallest number of kth powers needed to make all natural numbers

Note that the ≥ is needed in this equation as the term g(k) is merely a lower bound as by adding on zeros tothe sum still follows all necessary conditions and hence the term g(k) can become an infinitely long summationi.e. the number 18 can be represented by the following 4 squares:

18 = 22 + 22 + 32 + 12

In this case g(2) = 4 but obviously you can add an infinite amount of 02 to the summation above to makeg(2) =∞. This can be used on all g(k) and therefore shows that g(k) must be the lowest bound for the numberof ways a natural number can be represented by a sum of s kth powers. Waring’s problem is essentially anextension of Lagrange’s Four Square theorem which states that all natural numbers can be represented as asum of 4 perfect squares [16], in terms of the Waring’s problem notation this would give g(2) ≥ 4 which we justshowed for 1 example above for the number 18.

A formula for g(k) has been found due to work of multiple mathematicians over the years, it was first pro-posed by Waring and he stated that the lower bound for g(k) can be found by the following formula [16]:

Equation 5. g(k) = 2k + [ 32 ]k − 2

Obviously this formula for g(k) is not always an integer so we round the number down to the next integerfor example when k = 2 g(k) = 22 + [ 32 ]2 − 2 = 17

4 we round down so g(k) = 4. It is very easy to calculate thenthe lowest value g(k) and hence find the lowest number of kth powers needed to represent all natural numbersas a sum of those powers. However this begs the question of how does Waring’s problem help us solve andunderstand the Goldbach Conjecture?

Hardy and Littlewood began investigating the function G(k) which is essentially the same as the above g(k)however it investigates the number of ways a sufficiently large n can be represented as a sum of kth powers, withsufficiently large meaning that n follows some constraint. However this G(k) has an upper bound which itselfis g(k) so we say that G(k) ≤ g(k). We then look to find the bulk of G(k) and to solve such a problem withthese boundary conditions and constraints requires the use of the following Hardy-Littlewood circle method.

1.3 Hardy-Littlewood Circle Method

The Hardy-Littlewood Circle method is often used in analytical additive number theory. The circle methodhelps deal with additive problems over different sets. This is why it is one of the most commonly used methodsin analytical number theory as it allows different problems to be analysed but using the same method.

Page 9: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 9

1.3.1 Generalised Additive Problems

We mentioned that the circle method helps solve additive problems over specific sets and over certain bound-aries. We take a set A and we ask how many natural numbers can be made as a summation of the elementsin that set? For example for the Goldbach conjecture we are specifically looking at the set P as we are onlydealing with adding prime numbers together. To write this general method using a set we write:

Theorem 4. Given some A ⊂ N what n ∈ N can be written as a1 + a2 + ...+ as for ai ∈ A with i ∈ [1, s] and1 ≤ s ≤ n

Now we are solving an additive problem over a certain set we can find its generating function in the same wayas we have done in all the previous examples. Again we use generating functions for all the elements in the set A:

f(x) =∑a∈A xa

f(x)s =∑∞a1xa1

∑∞a2xa2 ...

∑∞asxas

f(x)s =∑∞n=0 rs(n)xn

The coefficient rs(n) here is equal to the number of ways it is possible for n to be written as a sum of selements ai ∈ A. Finding rs(n) however requires the use of complex analysis functions to find the solution.Using the Cauchy integral formula [3]:

Equation 6. rs(n) = 12πi

∫Cf(x)s

xn+1 dx where C = {x ∈ C; |x| ≤ 1}

1.3.2 Dissecting the Integral

Hardy and Littlewood showed that the above integral can be solved by splitting the integral limits. Howeverthis solution relied on the assumption of the generalized Riemann hypothesis. Vinogradov later refined Hardy-Littlewood’s work, namely removing the dependence of the Riemann hypothesis and showing that the f(n)s

can be replaced by the sum: [3]

Equation 7. F (α) =∑e(αmk) where e(x) = e2πix

Now by the same method as we have used multiple times we get the following:

F (α)s =∑rs(n)e(αmk)

Now by simple computation we know that:

∫ 1

0e(kα)dα = 1 if k = 0∫ 1

0e(kα)dα = 0 if k 6= 0

Putting together the above summation for F s(α) and using the orthogonality of the integral we can get theintegral equations that gives the solution for rs(n):

Equation 8.∫ 1

0F (α)se(−αn)dα = rs(n)

The way this technique is implemented into the Goldbach conjecture and other additive problems such asWaring’s problem is simple once you see how it is done. For the Goldbach conjecture we are looking at the sumof 2 primes being some even number n. By imagining this problem in terms of the general additive equationstructure we used above we have that s = 2 and A = P we get the summation for F (α):

Fn(α) =∑p≤n e(pα)

Fn(α)2 =∑p1≤n

∑p2≤n e((p1 + p2)α)

By putting this into the integral we can find an equation for r2(n):

Page 10: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 10

r2(n) =∫ 1

0Fn(α)2e(−nα) =

∑p1≤n

∑p2≤n

∫ 1

0e((p1 + p2)α)e(−nα)

=∑p1≤n

∑p2≤n

∫ 1

0e((p1 + p2 − n)α)

The Hardy-Littlewood method from this point onwards dissects the integral above into 2 parts. These 2parts are integrals over certain boundaries called the ”Major” and ”Minor” arcs. If we say that IM = MajorArc Integral and Im = Minor Arc Integral the above equation splits into the sum of these 2 integrals:

r2(n) = IM + Im =∫MFn(α)2e(−nα) +

∫mFn(α)2e(−nα)

However this asks the questions; What are the major and minor arcs? And what contribution do they haveto solving for rs(n)? Once the integrals are found the order between the 2 must be analysed. What we arelooking for is that we want the minor arc integral to have a small order in comparison to the major arcs. Thisimplies that the minor arcs contribute less to the overall integral over the range [0, 1] and hence can be ignored.It then suffices to show the integral over the minor arcs have a significantly small order for all n. If this is truethen it implies that all n can be written as a sum of elements from some chosen set. This is easier for large nand becomes more difficult as n gets smaller. However showing that the minor arc integral has a sufficientlysmall order in comparison to the major arc integral for the Goldbach conjecture is extremely difficult and is whythe problem remains unsolved. The reason why the Goldbach conjecture (as oppose to other similar additiveproblems) is hard to solve using this method is that for when s = 2, as it is in the strong Goldbach conjecture,the Major and Minor arc integrals state the both integrals contribute the same amount to the integral over theinterval [0, 1]. This doesn’t give the desired result as we are looking for a significantly low contribution fromthe minor arc integral. Surprisingly however the minor arcs show significantly low order for when s ≥ 3 whichis why Vinogradov’s Three Prime Theorem was relatively easy to solve for significantly large numbers.

1.4 Sieve Theory

Sieve Theory is a method used in number theory which essentially estimates the elements in a subset. Sievemethods are a very useful ways to tackle hard number theory problems such as for example:

i) Are there infinitely many primes p such that p+2 is also prime? (Twin prime conjecture)

ii) Is every sufficiently large even number the sum of two primes? (Goldbach conjecture)

The most well known type of sieve is the sieve of Eratosthenes which is used to create a list of prime upto some upper bound. We will discuss how this sieve works and how it and other sieve theory can be used inhelping solving the Goldbach Conjecture.

1.4.1 Sieve of Eratosthenes

The Sieve of Eratosthenes is named after the Greek mathematician Eratosthenes of Cyrene also known forcalculating the circumference of the Earth. The Sieve of Eratosthenes is a simple algorithm of finding the primenumbers from 2 up to a given limit n. The algorithm works as following:

i) Create a list with all the numbers from 2 to n

ii) Start from p = 2

iii) Mark as composite all the multiples of p up to n

iv) Repeat step 3 by choosing the next unmarked number. If no such number exists then stop.

The remaining unmarked numbers are a list of all the primes up to n. Here we demonstrate how the methodworks for n = 100:

We begin with a list of all the number from 2 to 100

Page 11: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 11

1st iteration mark all the multiples of 2

2nd iteration mark all the multiples of 3

3rd iteration mark all the multiples of 5

4th iteration mark all the multiples of 7

Page 12: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 12

The rest of the numbers in the last grid are all prime and hence added to the list and we get the final listof primes up to 100 to be 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89and 97. A quick improvement on this algorithm is to stop the iterations at the largest prime less than sqrt(n)because after that the multiples are already marked while iterating for the smaller prime numbers. For exampleto find the prime numbers up to 100 we need to iterate up to p = 7 (72 = 49, 112= 121) [?]. In our reportwe use this method for prime finding as it is quick, easy to program and relatively efficient for finding a list ofprimes. Before going deeper into the Sieve of Eratosthenes and how it is related to the Goldbach conjectureand how we can use it in our coding for verifying the conjecture, it is essential to briefly explain the basic ideasabout the Sieve methods.

1.4.2 Goldbach Partitions

Using Sieve methods, mathematicians are making progress towards the solution of the Goldbach conjectureand similar problem which require sieves to solve. For example, in 1966 Chen proved a weaker version of theGoldbach conjecture stating that every sufficiently large integer is the sum of a prime and a semi-prime wherea semi-prime is number that has at most 2 prime factors [21]. The fundamental goal for a sieve in it’s mostgeneral case is to find an upper and lower bound for the following set:

Equation 9. S(U , ℘, z) = #{n ∈ U such that p|n⇒ p > z, ∀p ∈ ℘} where U is a finite subset of N, ℘ is asubset of P and z > 0

For an appropriate choice of U , we can alter the general sieve above to find the number of the primes thatsum to make a fixed even integer. These pairs of primes are defined as the Goldbach (or occasionally Gold-bachian) partitions of n. We define the set U as:

U = {n(2N − n) such that n ∈ N, 2 < n < 2N − 2}

and by using the sieve method over this subset we get:

Equation 10. S(U ,P, x) = #{(p, 2N − p) ∈ P 2 such that√

2N < p < 2N −√

2N}

The above S gives the number of Goldbach partitions of the even integer 2N for 2N > 2 in the intervalI = [

√2N, 2N −

√2N ]. If one shows that this S > 0 for all 2N > 2 then this is sufficient to prove the Goldbach

conjecture. Let the set A = {(p, 2N −p) ∈ P 2 such that√

2N < p < 2N −√

2N} be the set of all the Goldbachpartitions in the interval I [?].

Proving that the Goldbach partitions of an even integer is always greater than 0 seems as though it wouldbe the most efficient way to prove the conjecture, however to prove that the Goldbach partitions follow someasymptotic relation must be solved using the Hardy-Littlewood circle method as we have previously done.However when solving for the asymptotic nature of the Goldbach Partitions to find such a formula requires theassumption of the generalized Riemann Hypothesis. Luckily as oppose to the Hardy-Littlewood circle method,this method of searching for the Goldbach partitions can be easily implemented into computational coding.We aim to investigate these partitions of even integers 2N and analysis the nature of the Goldbach partitionsas N increases. In this project we will use the sieve of Eratosthenes as our main prime finding tool and thenimplement it into relevant coding in order to find the Goldbach partitions of even integers greater than 2.

1.5 Limitations of Theoretical Methods

Investigating such a problem as the Goldbach conjecture has many difficulties and limitations involved whentrying to tackle the problem. Despite help from each other, lecturers and our project advisor the understandingof the mathematics underpinning the theory of the conjecture was a hard and long process. Many of our grouphave only just been introduced to the world of Number Theory and Combinatorics; with a mix of us readingboth topics, one of the topics or neither. This meant that we had to cater to peoples strengths in the topicas otherwise it would have hindered our final project report. Although we felt that we had the most effectivepeople working on understanding and researching into the theory of the conjecture and similar problems andhow they are solved and proven without computational methods, there were always difficulties with such anopen and abstract problem. Finding reliable sources and papers in the problem was an area of research whichwe were not familiar with due to our inexperience, and such a famous problem as the Goldbach conjecture hasits ‘proof’ and unreliable sources as it is so well known in the mathematical community.

Page 13: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 13

Once we found reliable sources to research and read to help us write our introduction to the report. Wefound that the level of mathematics in the papers was more often than not, far beyond anything we had everseen before hand. This in turn meant that we had to do extra research to find how the papers came to theirconclusion and understand the process in our own words. Although this was very difficult and a steep learningcurve for us all, it did allow us to learn new skills of interpreting difficult and very thorough reports, and learninghow to be able to understand the report in our own words to then pass on our findings to our peers in wayswhich they would also understand.

Despite all our efforts to convey the theory of the conjecture and the tools used to verify the conjecture, itbecame very apparent that we could not use these methods to find any notable breakthroughs in verifying theGoldbach conjecture. Simply due to the fact that the mathematics was far beyond our knowledge. However wefelt that the most effective way to show our understanding of the theory and provide some of our own findings,was to structure the report in such a way that we show our theoretical knowledge in the introduction, and findsome original independent data in our findings section. This would allow us to minimise these limitations ofthe theory and allow us to find some useful data to interpret in out findings section.

1.6 Primality

A large part of our findings is our attempts to verify the conjecture for larger and larger numbers, on the way todo this we looked in more detail at a couple of areas of primality. These were prime finding and prime testing.Before we look at those two in more detail is is important to explain why they compose a key part of our report.As we made our initial naı̈ve program it soon became clear that even though the slow part of the program wasthe algorithm to verify the conjecture this whoever could not easily be improved. As we researched ways otherpeople had gone about verifying the conjecture no material could be found on the algorithm used but instead allthe current research was focused on primality. Tomas Oliveira e Silva, Siegfried Herzog, and Silvio Pardi whoverified the conjecture up to 4 × 1018 [19] used about 781.8 single-core CPU years to verify upto this number.This was obviously not something we had access to or time to do.

1.7 Computing for Primes

Considering the fact that the Goldbach conjecture has gone unsolved for nearly three centuries is a testamentto the difficulty of proving it many analytically. Many of the best mathematicians to have ever lived haveattempted to prove the conjecture including Leonhard Euler and Christian Goldbach himself, but to no avail.Naturally with this type of problem, there is a tendency to test the conjecture for different numbers and withthe recent development of computers this method of verification has advanced exceptionally. Very efficientcomputer programs have now been written that can verify the conjecture up to 4 x 1018 [19]. Much of the workthat is done on the conjecture today is focused around this idea of writing extremely efficient programs thatcan verify the conjecture for large values.

As understanding the theory behind the Goldbach conjecture and the methods used for solving it weredifficult enough, trying to think of ways to implement these methods into our own computational code becameeven more challenging. We decided that focussing on certain aspects of computing that can be linked and usedfor solving the conjecture. There are two key areas within computing that have a big impact on the efficiencyof such programs. These are prime finding and primality testing. It is important to note the difference betweenthe two. Prime finding is the concept of building a list of prime numbers whereas primality testing is checkingwhether a given number is a prime or a composite number. In addition, the two methods are not always usedtogether as it may be normal to assume. This is because it is possible to build a list of primes without testing ifany number is prime as can be seen in the sieve of Eratosthenes. Although both of these ideas can be quite simpleto comprehend, they have proved to be areas of difficulty when it comes to writing efficient programs to facili-tate them. The inefficiencies in these programs are amplified when every number up to a very large n is checked.

In this report we will look at some of the techniques used in these areas and will discuss how they have de-veloped. For Prime Finding we will look at two techniques. One will be looking at sieves to find a list of primes,particularly the sieve of Eratosthenes and using a sieve to compute the Goldbach partitions. We will also look atthree different primality tests. These are Fermat’s Primality Test, the Miller-Rabin Primality Test and the AKSPrimality Test. In our findings section we compare the different methods against each other in terms of compu-tational efficiency, complexity and theoretical order. We do this by developing our own programs to implementthese techniques and developing findings based on these. By focussing on these aspects of computing to findprimes we can find our own original findings comparing these tests to find the most efficient code which can then

Page 14: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 14

be implemented into helping verify computationally the original conjecture and other problems of similar nature.

2 Methodology

This section will detail the direction which was taken in order to formulate the report this includes the decisionsthat were made, why these particular decisions were made, and the way in which the group functioned as ateam, including any pitfalls that occurred during the project’s progression.

The group’s work on the project began with discussions regarding the plan for said project, which outlinedthe basic aims of the project, as well as the specific tasks that would be undertaken by the various members ofthe group, and by which point these tasks would be completed. These discussions spanned the first two weeksof the project.

In order to facilitate ease of communication and the sharing of work and ideas, Dropbox was utilised, anda Facebook group was created. It was agreed early on that meetings should occur on a biweekly basis: onMonday afternoons (supervised by Gihan Marasingha, the project adviser) and Thursday mornings. This al-lowed the members of the group sufficient time to undertake the tasks that had been assigned to them, whilstalso enabling frequent collaboration, during which time members could raise any concerns they may have aboutanything concerning the project.

The initial phase can be split into two key areas: the theoretical side and the computational side. Whenformulating the project plan, which detailed the tasks which were necessary to complete for the project tobe completed, and who would perform each task, the objectives were broadly defined as either ‘theoreticalor ‘computational. This provided the group with a clear view of what needed to be done, and how to do it,whilst also enabling a reasonable level of leeway only immediate tasks were assigned to specific group mem-bers at this stage. This was done because it meant that if any member was unable to complete a task forsome reason, it would be relatively unproblematic for another person to cover their tasks as well such flexi-bility could not be defined with a rigid approach whereby each person has every task mapped out from the onset.

The theoretical side, which was dominant during these first three weeks, consisted of understanding thetheory behind Goldbach’s conjecture, and the research that had been done in the past towards solving theproblem. The topics that had the strongest links to the conjecture, such as the Hardy-Littlewood method andWaring’s problem, were granted the heaviest weighting, and this research was undertaken primarily by Marshal,Sai and Ally, though all members began researching sources during this time without a solid understandingof the basic theory, very little progress could be made, so it was necessary for all group members to be on asimilar page. In particular, Pollack’s paper on Waring’s problem was especially helpful in advancing the group’sunderstanding of the subject [15]. Matt focussed on the historical context of Goldbach’s conjecture itself, inparticular the advances that had been made towards solving it, as well as failed attempts in the past to provethe conjecture. This research was intended to inform the direction of our own project, through considering thetriumphs and mistakes of predecessors and learning from them. Another important research topic was primalitytesting. Initially, primality testing was performed through either the sieve of Eratosthenes, or a ‘brute-forceapproach (i.e. iterate through each prime number respectively to see if a given number divides into it). Alan andBarry focussed on finding more effective prime algorithms, with Alan in particular looking into prime ladders.

On the computational side, during these first three weeks, Matt, and Alan produced naı̈ve programs thatverified the Goldbach conjecture for low numbers, with the intention of improving these programs later viaresearch done during the project. The programming languages used for these were Python (used by Matt)and Matlab (used by Alan). At the same time, Leo did considerable research into the sieve of Eratosthenes,and produced a program, also in Matlab, which tested the algorithm, along with a graph which mapped theamount of time required to compute the number of primes within certain values of n. He also researched intopapers exploring sieves that built upon this groundwork, including Chen’s sieve [9], which will be explainedin more detail in the next paragraph. Matlab was chosen to be the primary programming language used forthe duration of the project, largely due to its ease of use and the fact that it was a language that all groupmembers were familiar with, whereas some group members were less familiar with alternative languages suchas Java and Python. We also considered another option which was for each person to code using the languagethey were most comfortable with, but this posed a number of possible problems - one implementation in onelanguage might be quicker than in another language and so introduce another factor to be considered. Otherresearch literature detailed the use of programming languages such as C [7] and Assembly language [19] as usedby Thomas Olivera. Both of these languages are potentially faster than Matlab, however no one in the group

Page 15: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 15

had any experience or knowledge of them.So in a project with a time limit of eleven weeks (thus meaning thatacquiring sufficient knowledge of a new programming language was not feasible), it was necessary to utilise alanguage which everyone had some knowledge of, and was comparably user-friendly, and Matlab was consideredthe most effective choice in this regard. Matlab was also proficient at modular arithmetic, which was very helpfulduring later stages of the project, especially primality testing. It was also ideal for all tests to be programmedin the same language, to more effectively compare their efficiency using different programs for each test mighthave led to discrepancies based on their respective coding platforms, rather than the efficiency of the programitself. Through group collaboration, these tests could also be performed by the same group of people and onthe same system. This is very rare amongst projects in this field, and thus was very helpful in informing ouroriginal research, as it eliminates as many potential biases as possible and provides a fairer comparison.

During our research for the Goldbach conjecture, we came across the book “The Goldbach conjecture byYuan Wang [24]. We found the chapter “The Goldbach conjecture and the Sieve of Eratosthenes was reallyuseful for our report as it had all the information we need in order to link the Sieve of Eratosthenes, which isour main prime finding algorithm, with the Goldbach/Goldbachian partitions of an even integer > 2. In thischapter we found a simple method to find the Goldbach partitions of any even natural number greater than 2,using just the sieve of Eratosthenes, which we coded in Matlab, using the programs we already made for theSieve of Eratosthenes. This gave us the initiative to start investigating the nature and number of the Goldbachpartitions, which then evolved into a big part of our findings. Note that this book is really useful for researchon the Goldbach conjecture as it covers most of the material related with the problem, and it is a reliable source.

It is also worth commenting on the reliability of one particular source used in the programming part ofthis project. [18] This website is a part of the personal website of Tomas Oliveira e Silva, and it explains thecomputational work that he and people alongside him have done in the verification of the conjecture. He hassubmitted a paper of this verification technique as well [19] which is referenced in our other sources such asHelfgott’s Paper [7]. Consequently, it is safe to assume that he is a reliable source in the field of computationalnumber theory, especially because his work relies upon the conclusion that Helfgott makes. Obviously undernormal circumstances, a website would not be an appropriate source for this kind of report, but it expands onmany of his methods that he used in his verification attempts, and therefore has been of great help to our reportand used widely. For these reasons we have included this source and believe it to be both valuable and reliable.

The naı̈ve programs produced would ultimately be vital in informing our later research into primes. Thenaı̈ve programs consisted of two parts: the prime finding side, and the ‘Goldbach summing side. The latter wasvery simple, and thus did not need any significant improvements. The prime finding aspect was of mixed effi-ciency depending on the program - the one which Alan wrote using the Eratosthenes’ sieve that Leo programmedearlier was very efficient, while others such as Matt’s, that relied on a ‘trial and error system of finding primes,were considerably less efficient. It was during this time that the group agreed that primality testing would bea necessary area to focus on in our report this is because it is the area which has the most practical appli-cations outside of the conjecture, unlike the summation side of the program, which has no applications otherwise.

However, a major hindrance to the project came very early during the formulation stage. Near the end ofweek 2, one of the group members fell ill and was hospitalised. Their health continued to falter throughoutthe next several weeks, and consequently they were unable to contribute significantly to the project. Thus, itbecame necessary for the group to reconsider who was going to perform which tasks. This was partially whythe group opted for a less rigid task assignment system during the project planning stage no one was sureof how long it would be until they were well enough to work again, and thus the group had to consider thepossibility that the project might have to be undertaken with seven members instead of eight. Despite someearly struggles, ultimately, the group was able to overcome the issues that came with having one less personavailable fairly quickly this reflects the strong level of teamwork that the group has fostered.

On the Thursday of week 3, the first update presentation of three was given the speakers for this talk wereAlly and Leo. This presentation consisted of introducing the Goldbach conjecture, along with several of themathematical methods involved with it such as the Hardy-Littlewood method, as well as outlining the basicaims of the project. Practical tasks that had been completed at this stage consisted of finishing the naı̈veprograms verifying Goldbach’s conjecture, and ensuring that everyone had a decent knowledge of the necessarytheory. This presentation was prepared over a period of less than a week, and ultimately the group did a solidjob of relaying the crux of the project under the given time constraints.

During the Thursday meeting in week 4, after all members had gained a baseline understanding of the prob-lem, combined with a full awareness of the tasks which needed to be completed, as encouraged by a discussionwith the module leader which allowed us to rethink our strategy, the goals outlined in the project plan could

Page 16: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 16

be put firmly into action. As mentioned, research had been performed into sieves and primality testing duringthe past weeks, and it soon became clear how important this area was not just to the Goldbach conjecture, butalso many areas of mathematical interest. It was decided that a solid course of action for the original researchin our project would be to produce an analysis and comparison of these algorithms. This entailed coding thealgorithms and testing their efficiency, as well as computing their theoretical order, which could subsequentlybe compared to the order of their implemented algorithm in practice. This would make it possible to determinewhich algorithms were the most effective from various perspectives. To facilitate this, these algorithms wouldalso be tested on a time-scale graph (as Leo had done earlier with Eratosthenes’ sieve) to allow further compar-ison between them. This would provide the group with original data which was relevant to the conjecture, andbridge the gap between the theoretical knowledge that had been built up already, and the practical requirementsof researching and analysing the problem at hand. Furthermore, the production of the necessary programs in ashort space of time acted as an efficient way of consolidating the proficiency with Matlab that Alan and Barryhad gained through previous modules.

During week 5, in order to facilitate research into a range of different approaches, whilst also acknowledgingthe time and resource constraints of the project, it was decided that three specific primality tests should befocussed on, alongside the work on sieves and prime ladders. Fermat’s Test was chosen because it is one of themost straight-forward primality tests in existence, and has clear limitations because of being probabilistic. TheMiller-Rabin Primality Test builds on and improves Fermat’s Test (while still suffering some of its shortcom-ings), and is frequently used in programming languages such as Matlab, and thus was also a logical choice oftest to analyse in-depth. The final choice was the AKS Primality Test, as showcased in the academic paper‘Primes in P [11] This test stands in contrast to the previous two because it is deterministic, albeit noticeablyslower. These three tests effectively showcase the development of primality testing over time, and also providedan opportunity to consider the strengths and weaknesses of probabilistic and deterministic tests. Alan andBarry, who had done the greatest amount of research into primality testing up to this point, were chosen tocode the algorithms. Likewise, during weeks 4 to 6, Leo continued refining his research into sieves, and thencoding up the results.

While it had been agreed that a greater focus on research into primes and the practical methods thereof wasnecessary for the project, the group also acknowledged that effort should continue to be devoted to researchinto the Hardy-Littlewood method and Waring’s Problem, because these areas are of critical importance to theconjecture, and to most of the developments that have been made when analysing it, along with related math-ematical areas. It also provided an excellent opportunity to enhance the group members’ skills with regards toevaluating and analysing sources through research. Research into the Hardy-Littlewood Method was continuedby Ally, and research into Waring’s problem by Sai and Marshal. Matt also finalised research into past proofsand context behind the conjecture during this time. During weeks 5 and 6, members of the group began tocompile and summarise the information that they had researched into coherent paragraphs, in preparation forusing this information in the final report.

On the Thursday of week 6, the second update presentation was given this time, the speakers were Alan,Barry and Matt. Alan and Matt presented a more detailed description of the direction of our project by convey-ing the research performed into the context behind the conjecture and the various theories related to it, whichultimately led to an approach focussed mainly on primality testing for our findings. From there, Barry gave asummary of the three types of primality tests that had been chosen for the project, including a brief run downof the methods they used, and their shortcomings. Once again, this presentation succeeded in getting acrossthe progress made towards the final report despite having been prepared in a fairly short space of time.

By the beginning of week 7, further headway had been made in our research into the various facets of Gold-bach’s conjecture and the research surrounding it, and also into Eratosthenes’ sieve. Two of the three primalitytests (specifically, the Fermat and Miller-Rabin test) had been coded by Alan, because his knowledge of Matlab,combined with the knowledge he gained from the Number Theory module, meant that he had the greatestunderstanding of the technical aspects of these tests. Barry also began programming the AKS test, though thisposed more difficulties than the other tests, being considerably more complex, and thus this program was notformulated until the beginning of week 8. Meanwhile, the process of refining and summarising of the theoreticalaspects of the group’s research was sped up at the beginning of week 7 it was during this time that work beganon the final project’s introduction and methodology.

Through weeks 7 and 8, each person took the roles that they had been given, and began to compile thedata connected to these roles together into a form that could be included in the final report. The introductionwas drafted primarily by Ally, utilising research undertaken by everyone in the group, while the methodologywas written primarily by Matt. All members added their contributions, corrections and references to these

Page 17: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 17

sections. During this time, Alan and Barry were finalising their coded algorithms, and compiling graph datathat analysed and compared these algorithms, combined with the sieves as coded by Leo, and had begun towrite up an analysis of this original data.

On the Tuesday of week 9, the last of the three update presentations was given the speakers this timewere Sai and Marshal. A third member was also originally intended to speak in this presentation, but due tofaltering health throughout the term, she was unable to do so. During this presentation, Sai detailed the projectwork that had been performed up to that point, in both computational and theoretical aspects, with Marshaldescribing in-depth the nature of Waring’s problem and the theorems surrounding it. This was a topic that thetwo of them had done considerable research into, and thus their analysis was robust.

By the end of week 9, all research had been completed into the theoretical aspects of Goldbach’s conjecture,a process which had taken considerably longer than had been expected. Consequently, the group’s theoreticalefforts could be devoted exclusively to writing up for the final report from this point onwards. The majority ofthe computational aspects of the project were finished as well, though certain technical difficulties with Matlabmeant that some refinement was necessary for a few programs, which was completed by the end of the week.It will help for us to expand on these difficulties a bit. In particular, the choice of Matlab as the program-ming language for this report lead to a number of unforeseen problems. The implementations of the Fermatand Miller-Rabin primality tests were seemingly very efficient, which ironically lead to problems as the timetaken to test small numbers of n were very close together, which made analysis more difficult. We then triedto use larger numbers but came across some errors as the test would return composite on known large primenumbers, anything over 9 digits. To overcome this problem, a number of methods were tried including ‘vari-able precision arithmetic (vpa), an inbuilt function in Matlab but the best solution was found by Alan whichinvolved using ‘Variable precision integer arithmetic (vpi), a package downloaded to work with Matlab from [8].Obviously, concerns about the validity of the package can be raised but functionally everything works and forthe purposes of our report, understanding how this worked would have been a massive hurdle, if more time wasavailable we would of course look in more detail at how this works. This enabled us to check numbers up to253 which was much larger than we were able to do before. This is still not ideal as we would like to be able tocheck numbers with hundreds of digits, but we found in the report that our programming skills and especiallyour understanding of the underlying parts of Matlab disallowed us from finding a way to use larger numbers.This fortunately was not too much of a problem, as can be seen in our findings, but is worth noting nevertheless.

From week 10 onwards, the vast majority of issues that had arisen within the Matlab programs had beenresolved, and efforts were fully concentrated on finishing the process of writing the sections of the report, andcompiling these sections in LaTeX. The LaTeX compilation was handled predominantly by Ally, who had thestrongest understanding of the software all of the files had been uploaded into the Dropbox, and thus couldbe pasted directly into the report as needed. The ‘Conclusions section proved to be the most difficult to writewhile evaluating the previous report sections was relatively straightforward, explaining coherently the extentto which the project had contributed to the problems at hand presented some issues. The conjecture has notbeen proven for over two centuries, and many mathematicians who have researched this particular field hadaccess to much greater resources and time than our group did. Thus, this section required a lot more thoughtto write-up, because, unlike the other sections, the correct course of action was much less clear-cut.

3 Findings

3.1 Naı̈ve Program

As stated in our methodology at the start of the project, a number of us worked on producing naı̈ve computerprograms to verify the conjecture as a starting point for this project. We decided to do this independently ofeach other to give us more chance of developing diverse and original methods of doing this. One of our moredeveloped naı̈ve programs did make use of the sieve of Eratosthenes which had been programmed beforehand.This eventual collaboration led to a program which was relatively efficient up to 100,000.

3.1.1 1st Naı̈ve Program

Our first naı̈ve program was implemented in Python and can be seen in [Appendix G]. It was based on a traildivision method and was incredibly slow even for small numbers. We decided not to continue with Python asreasons described in our methodology. Also this method was not the fastest one we found and so therefore we

Page 18: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 18

did no further work on it.

3.1.2 2nd Naı̈ve Program

Our second and more successful naı̈ve program utilised the Sieve of Eratosthenes function seen in [AppendixA] to create a faster naı̈ve program. An improved version of the sieve [Appendix B] was then used and can befound in [Appendix J]. This came as a result of our continued research into sieves. The program you can see herewas not the very first implementation and has received a number of small improvements over the course of theproject as a result of gathering further information from research literature or suggestions from other membersof the group. A lot of these were made as the program was being developed and so were not documented butjust added to the overall efficiency of the program. One improvement made was to check the second loop ofprimes backwards, this is because we are much more likely to gain a Goldbach partition with a small and large prather than 2 similar sized p. This came from reading work done on verifying the conjecture by Tomas Oliveirae Silva and his website explain his methodology [19]. We measured the efficiency of our program and plotted atime graph to get a visual representation of what exactly our program was doing in terms of efficiency. Fromthis we were able to see the shape of the curve as n increased.

Figure 3: Graph showing the time taken for our naı̈ve program to run for different value of n.

The graph has a parabola shape as the time taken to verify the Goldbach Conjecture for increasing values ofn rises exponentially. This shows that our program can be used for sufficiently small numbers, but as n startsto get very large, the program is virtually redundant, as it would take far too long.

3.2 Sieves

3.2.1 Sieve of Eratosthenes

As mentioned in the introduction, in order to create a list of primes we will mainly use the Sieve of Eratosthenes.

In order to analyse the algorithm and find an upper bound to the time required for the algorithm to returna list of primes we need to take account of how many iterations are required and how many operations aredone per iteration. For each prime number the program marks as composite all of its multiples that are lessor equal than n. Thus at each iteration the program does approximately n

p operations. So overall the program

Page 19: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 19

does n ( 12 + 1

3 + · · · + 1p′ ) operations where p’ is the largest prime less than n. Mertens second theorem states

that ( 12 + 1

3 + · · · + 1p′ ) = loglogn + B + δ where B is known as the Mertrens constant and ‖δ‖ < 4

logn so

( 12 + 1

3 + · · · + 1p′ ) ≈ loglogn [12]. Thus, If each multiple is dealt with in O(1) time, overall time required for

the sieve of Eratosthenes is O(nloglogn).

We produced 2 different pieces of Matlab code for the Sieve of Eratosthenes.

The first program removes from the list of the numbers from 2 to N the multiples of each prime number aswell as the prime number itself and at the end returns a list with the prime numbers up to the upper boundchosen. [Appendix A]

While the second program replaces the marked numbers (multiples of primes) with zeros, this program ismore useful in finding the Goldbachian partitions (See section 3.2.2) of even numbers. [Appendix B]

Figure 4: Graph showing time taken to find primes from 2 to n (Blue) and Cnloglog(n) (Red)

Figure 4 shows the primes from 2 to n as n goes from 1000 to 106 for every 1000. We have also plottedCnloglog(n)for some chosen constant C. This is the theoretical order of complexity of the sieve of Eratosthenesand from figure 4 it seems that these are similar for an appropriate choice of C. There are some outliers on thefigure that don’t make sense but these can be easily justified by CPU issues.

3.2.2 Goldbach Partitions

The set of the Goldbach partitions of an even number 2N greater than 2 can be found by using the Sieveof Eratosthenes. The idea is that using this algorithm, all the Goldbach partitions of an even number canbe obtained. However this is not sufficient to prove the Goldbach conjecture. An example for this method,specifically the even number 26, is demonstrated below: [24]

Figure 5: All the possible pairs of integers that sum to 26 are demonstrated. Each numbersummed with the number bellow gives 26, with red numbers composite.

Page 20: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 20

After applying the Sieve of Eratosthenes in both rows of the table, the only remaining numbers that sum to26 are pairs of prime numbers. So 26 = 3 + 23 = 7 + 19 = 13 + 13. Thus the set of Goldbach partitions of 26 is(3, 23), (7, 19), (13, 13). From these pairs, (7, 19) and (13, 13) are in the interval I = (

√2N, 2N −

√2N) while

(3, 23) is not.

Using the Sieve of Eratosthenes we create algorithms that find the set of all the Goldbach partitions of agiven even number greater than 2, the elements of the subset of this with the partitions that lie in the intervalI and the number of elements in each set. We start with a list of all the numbers up to an even number, say2N. So normally the sum of the ith number of the list and the (2N − i)th number is 2N and these are all thepossible pair of positive integers that sum to 2N. We apply the sieve of Eratosthenes on this list and we replaceall the composite numbers with 0. By replacing the composite numbers with 0, the resulting pairs that sum to2N will be pairs of prime numbers. Below we show the steps that constitute the algorithm:

Goldbach Partition Algorithm:i) Create a list of the numbers from 0 to 2Nii) Apply the Sieve of Eratosthenes to the numbers from 2 to N and replace all the composite numbers with 0instead of marking them.iii) Replace 1 with 0 as well. The result is a list of length 2N + 1 where all the numbers that are not prime arereplaced with 0iv) For 0 < i < n

2 test whether the sum of ith element and the (2N − i)th element is 2N. If it is then thesenumbers are a Goldbachian partition of 2N and we store them in a list as 2-dimensional vectors of the form (ith

element, (2N − i)th element)

When the algorithm has ended it returns a list with all the Goldbachian partitions of the even integer 2N.We created a Matlab function for this algorithm shown in appendix [Appendix C].

For example the set of the Goldbachian partitions of 1000 is {(3, 997), (17, 983), (23, 977), (29, 971), (47,953), (53, 947), (59, 941), (71, 929), (89, 911), (257, 743), (281, 719), (317, 683), (347, 653), (353, 647), (359,641), (383, 617), (401, 599), (431, 569), (443, 557), (479, 521), (491, 509)}

To find the subset of the Goldbachian partitions that lie in the interval (√

2N , 2N −√

2N) we just changestep 4 so it starts from the first number greater than

√2N and goes up to 2N

2 , this is because we only wanthalf of the chosen even number.

These algorithms were also modified in order to find the number of the Goldbachian partitions for each evennumber appendix [Appendix D].

By creating a for-loop with the Matlab function appendix Goldbach partition we can create a data set withthe number of the Goldbach partitions of each even number greater than 2 and make a graph of these data.However this is really inefficient because this way the program does the sieve of Eratosthenes for all the evennumbers up to the limit we defined. Using this program we could go only up to 10,000. So we created aseparate program that does the Sieve once and then using a double for-loop it evaluates finds the number ofthe Goldbachian partitions for each even number up to an upper bound. This algorithm enabled us to go up to100,000. The resulting graph is shown below. [Appendix E]

Page 21: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 21

Figure 6: Number of Goldbach Partitions of even numbers up to 105

From figure 6 it is clear that there is an overall increasing tendency for the number Goldbachian partitions,this is not entirely true on a small scale e.g. S(28)=2 while S(26)=3. As mentioned in the introduction in thelimitations section, our computers are not powerful enough to produce graphs including really big numbers.This graph is known as the ‘Goldbach comet’ due to its shape that looks like the tail of a comet(Reference to [23].

The scatter plot bellow shows the number of the Goldbachian partitions that lie in the interval I:

Page 22: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 22

Figure 7: Scatter plot showing the number of the Goldbachian partitions that lie in the intervalI

As expected the number of the partitions that lie on this interval is slightly smaller but it is still non zeroand has the same overall increasing tendency as the number of all the partitions. Moreover it looks like theyare approximately the same, this can be verified this by plotting the two scatter-plots on the same graph.

Page 23: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 23

Figure 8: Scatter plot of the Goldbach partitions (blue) and the scatter plot of the Goldbachpartitions in the interval I for even integers greater than 2 and smaller than 105.

Figure 8 provides clear evidence that the number of Goldbach partitions and the number of Goldbach par-titions in the interval I are approximately the same.

Using Matlab we were able to obtain the average ratio of the number of partitions and the number of theGoldbach partitions in the interval I for all even numbers greater than 2 and less than 105. For every number,we found the ratio of the number of Goldbach partitions in the interval I over the number of all the Goldbachpartitions, we then took the average of these ratios. The resulting average ratio was 0.9830. This indicates thaton average for 2 < 2N < 100, 000 the majority of the Goldbach partitions of a number in this interval lies onthe interval I. More specifically we found that on average 98.3% of the Goldbach partitions lie in the interval I[Appendix F].

The Goldbach comet graphs provides evidence that the conjecture is true, as shown in Figures 6,7 and 8 thereare no even numbers with zero number of Goldbach partitions, and it appears that the number of the Goldbachpartitions is generally increasing. However this is not sufficient to prove the conjecture, but a statistical analysisof these data can provide useful information for the number of Goldbach partitions of each number. Hardy andLittlewood derived an estimate for the number of Goldbach partitions G(n) by finding an asymptotic relationin 1923: [23]

Equation 11. G(n) ∼ nC(logn)2

∏p>2,p|n2

p−1p−2 where C =

∏p>2(1− 1

(p−1)2 = 0.066016...

3.3 Primality Test

3.3.1 Fermat’s Primality Test

Pierre de Fermat is most commonly know for his famous Last Theorem, that like Goldbach’s Conjecture, wentunsolved for centuries until it was eventually proved in 1995. Much in the same fashion, Fermat gave rise towhat is now known as his Little Theorem by stating the theorem in a letter to Frenicle de Bessy but withoutproviding a proof. It was later proved by L. Euler and published in 1736 [14] although it was subsequentlydiscovered that Leibniz had an almost identical proof dating before 1683 [4]. The proof is well known and canbe commonly found in literature, for example in Abraham Fraenkels Integers and Theory of Numbers [1].

Theorem 5. Fermat’s Little Theorem States: Let p be prime and a be any integer. Then:

ap ≡ a (Mod p) if p doesn’t divide a otherwise ap−1 ≡ 1 (Mod p)

Fermat’s Primality Test makes use of his Little Theorem.

Fermat’s Primality Test:

Let a be any integer. If gcd(a,p) = 1 and ap−1 6≡ 1 (Mod p), then p is composite. If ap−1 ≡ 1 (Mod p) formany a, then a is probably prime.

As can be seen in Fermat’s Primality Test, it does not explicitly say that p is a prime. This is because thereexists numbers known as pseudoprimes which are composite but share some of the specific properties of prime.They are also less formally known as Fermat Liars. The term probably prime is a number that is either a primeor a pseudoprime. A base-a pseudoprime is any composite number p that satisfies Fermat’s Little Theorem.For example:

Take p = 4 and a = 5 then 53 ≡ 1 (Mod 4). However 4 is obviously a composite number and therefore 4 isa base-5 pseudoprime.

In the case where a = 2, this theorem is equivalent to the Chinese Primality Theorem which was originatedin around 500 BC [25]. Fermat essentially generalised what the Chinese had done before him by allowing forthe test to be done in several bases instead of just being done in base-2.

Theorem 6. Chinese Primality Theorem:

Let n be an integer, n > 1. If 2n ≡ 2 (Mod n) then n is either a prime or a base-2 pseudoprime.

Page 24: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 24

The Chinese Primality Theorem also had the problem of pseudoprimes. Base-2 pseudoprimes were infre-quent enough for the theorem to be genuinely useful but still left a fairly large margin of error. By implementingFermat’s generalisation of the Chinese Theorem, which tests the number p across several bases, the chance thatp would pass his Primality Test for each value of a and still be a pseudoprime is dramatically reduced. Thisis because there exist different pseudoprimes for each base so using more than one base is a method of crosschecking. So if a composite number n passes the Primality Test for base-2 but not for base-3, then you know nis a base-2 pseudoprime. However Fermat did not fully resolve this issue as there are some composite numbersthat are pseudoprimes for all bases. These are known as Carmichael Numbers. It should be noted these areparticularly rare, with there only being 105212 Carmichael Numbers up to 1015 [17].

For this very reason, Fermat’s Primality Test cannot be fully trusted as it is not deterministic. Due tothere being a small chance a number that Fermat’s Primality Test says is prime, is in fact composite, makes histest a probabilistic one. However as these probabilities are extremely small, probabilistic methods have provedpopular, particularly in computer programming where efficiency is of integral importance.

We have implemented Fermat’s Primality Test ourselves by writing a computer script to be implemented onthe Programming Language Matlab. [Appendix K]

Figure 9: Our program that performs Fermat’s Primality Test up to 1,000,000, averaged over100 times.

We tested the program for the all the primes up to 1,000,000 by running the test over a list compiled fromthe Sieve of Eratosthenes. By using a scatter plot we can see the time taken to test whether the primes arein fact prime has variance of about 0.05 seconds for all prime numbers close to that region. That is becausethe CPU usage on the computer we used to test this is constantly varying. We have mitigated this varianceby clearly displaying this on a scatter plot. Further mitigation was achieved by testing up to a sufficientlyhigh number, in this case 1,000,000. By testing to a high enough number, we can see the upward trend of thegraph which indicates the program performing Fermat’s Primality Test takes longer as n gets larger. This isvery much as we expected, as the program has to perform many more computations the greater the value of n.However it can be seen that the graph has a rather shallow gradient and when this graph is created for a muchsmaller domain, the gradient can seem even smaller. It can also be seen that for primes relatively close to zero,the Fermat Primality Test is able to verify that these numbers are prime very quickly.

Page 25: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 25

We felt that this graph wasn’t fully representative of the shape that the Fermat Test time graph shouldlike. As mentioned before the graph is shallow rather straight whereas we expected the graph to have more ofan exponential-like shape. We suspected we weren’t getting these results because our domain was too limited.This was a problem we encountered as a result of using Matlab to implement these tests. Matlab is considerablypoor at working with large numbers which obviously meant implementing the Fermat Primality Test for largenumbers was impossible. In an attempt to overcome this problem, we used the downloadable Matlab packagecalled VPI. This then allows Matlab to be able to work with much larger numbers without loss of precision.Below is a graph with us now using VPI.

Figure 10: Our program performing Fermat’s Primality test up 253.

As you can see we were able to able to test up to these very high numbers using the VPI function in Matlab,which allows the programming language to perform calculations to these far greater numbers.

Furthermore, the shape of the graph is considerably different to figure 9 and now far closer to our expecta-tions. The graph no longer has a linear shape and is now more curved. We can now easily see that the timetaken to perform Fermat’s test grows exponentially as n gets larger.

It should be noted that the domain of the two graphs differs slightly. In figure 9 we performed the test onlyon primes found from the Sieve of Eratosthenes but in figure 10 we performed the test on numbers of the form2n − 1. Numbers of that form are known as Mersenne Numbers. The reason we used Mersenne numbers forour domain is because our Sieve of Eratosthenes was very inefficient when dealing with numbers as large as 253

so we were unable to perform the test on a list of primes. Our solution to this problem was to use MersenneNumbers because they share a common property with primes, so many of them would be prime. This enabledus to run the program efficiently up to 253 with the guarantee of testing many prime numbers.

3.3.2 The Miller-Rabin Primality Test

There have been several Primality Tests that follow on from Fermat’s and it is his Little Theorem that plays akey part in all of them. One of the most popular and widely used is the Miller-Rabin Primality Test. This testis often used in programming languages’ inbuilt functions, including, which is the language we have conductedour research in.

Page 26: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 26

The theory behind the test makes use of some interesting properties for primes. If we take an odd prime n.

then bn − 1 ≡ 1 (Mod n) by Fermat’s Little Theorem. If we take bn−12 = x as n − 1 is even. It is clear that

x2 ≡ 1 (Mod n), so therefore x ≡ ±1 (Mod n). If n−12 is still even and x = +1 then the process can be repeated.When this process is continued until either the exponent is no longer even or x 6≡ 1 (Mod n), a prime numberwill end up with either x = −1 or x = 1. Under modulo n, x = −1 is equivalent to x = n − 1, so for a primenumber, the Miller-Rabin Test will have x = 1 or x = n− 1. If x is not one of these values then the number nbeing tested is a composite.

The Miller-Rabin Primality Test:

Given an odd integer n, let n = 2r.s+ 1 with s odd. Choose a random integer a with 1 ≤ a ≤ n− 1. Ifas ≡ 1(mod n) or a2js ≡ −1 (mod n) for some 0 ≤ j ≤ r− 1, then n passes the test and is probably prime. If n

fails the test then n is composite.

Much like Fermat’s Primality Test, this test also suffers from the problem of pseudoprimes. Due to therefined and strict nature of this test, these numbers are commonly known as strong pseudoprimes. However thenumber of pseudoprimes are dramatically reduced. The Miller-Rabin Test is of course probabilistic due to theexistence of such strong pseudoprimes however there is a limit to the number of bases a strong pseudoprimecan pass.

Theorem 7. Let n be odd and composite. Then n passes the Miller-Rabin test for at most n−14 bases b with

1 ≤ b ≤ n− 1. [[14]]

This limit on bases could become even more restricted if the well-known Riemann Hypothesis is true. Onlybases up to 2(logn)2 would need to be checked if the Riemann Hypothesis is true. In fact, this is how Gary Millerfirst developed the test before later adjustments from Michael Rabin to make it an unconditional probabilistictest. From the above theorem it can be seen that the test can theoretically be thought of as being deterministicbut it should be noted that for very large n, it would be extremely impractical to test n for n−1

4 bases. Theprobability that a number that passes the Miller-Rabin Test is composite can be calculated. Suppose that npasses the test for some base b where 1 ≤ b ≤ n − 1. Then from the theorem above it can be seen that themaximum probability of n being a composite is 1

4 . If the test is done over k different bases, the probability thatn is composite is 1

4k. So as k increases, the probability of coming across a strong pseudoprime decreases rather

quickly. For example if we test over 100 bases, then the probability of n being a strong pseudoprime is 14100 ,

which is less than 10−60.

We wrote a computer program to carry out the Miller-Rabin Primality Test. Below is a graph showing thetime taken for the program to perform the Miller-Rabin Primality test as n increases. [Appendix M]

Page 27: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 27

Figure 11: Our program that performs Miller-Rabin’s Primality Test up to 1,000,000, averagedover 100 times.

The first thing that is possibly most notable is that this graph has no values with time close to zero like wesaw with the Fermat test. This is simply because the Miller-Rabin test builds on the Fermat Primality test, wedeemed it redundant to test on composite numbers. We therefore conducted the test on a list of primes whichwe gathered using the sieve of Eratosthenes. This freed up some running time within the program and allowsus to test even higher numbers with more efficiency. We performed the test on every number, 100 times andused the average to make sure our results were as fair as possible.

There are certainly similarities with the Fermat graph in figure 9. For example both graphs have someresults that appear to take a little longer than the general trend due to CPU activity elsewhere. Furthermorethe time taken for n close to zero have massively varying results, most likely also due to the fact that thecomputer is using different amounts of CPU usage to start the initial call on the program. More interestinglyhowever is the shape of the graph. Like the graph for Fermat’s Primality test, the shape of the graph appears tobe particularly linear. This suggests that the Miller-Rabin test is not very sensitive to change in n, the numberbeing tested. Well this is certainly the case for smaller numbers like we can see here. But the graph does showmore of an upwards gradient than that of the Fermat graph. We believed that if we could test the Miller-RabinPrimality Test for much larger numbers, we would see a far more obvious positive gradient in the graph. Wetherefore also used the VPI() package on Matlab for the Miller-Rabin test. The graph below shows our results.

Page 28: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 28

Figure 12: Our program performing Miller-Rabin’s Primality test up 250

For the same reasons as in the Fermat graph, we performed this test using Mersenne numbers. The resultsfrom this graph were very much what we expected. There is a clear positive gradient and therefore the programtakes longer to test if n is prime as n grows. Also we expected to have a number of peaks and troughs. Thepeaks are when the number 2n − 1 are in fact prime. Then the Miller-Rabin test has many more operationsusually to confirm that this number is prime. In the same way, the sections between these larger peaks aresimply a number of composite numbers being tested which of course can be performed much more quickly.

3.3.3 AKS Primality Test

As has been show in the previous two Primality Tests, finding an efficient algorithm to test if a certain numberis prime has been a difficult challenge and this has lead to the creation of probabilistic tests in order to gaingreater efficiency. Clearly these Primality Tests have been edging towards the ideal; a deterministic algorithmthat is extremely efficient. It just so happened that this ideal was discovered in 2002 by three academics at theIndian Institute of Technology. They were named Manindra Agrawal, Neeraj Kayal and Nitin Saxena, and socame about the name, the AKS Primality Test [11]. In their published paper detailing their algorithm, theyexplain the key theories that led to the proposed algorithm and discussed its time complexity. The algorithmis actually able to run in polynomial time and this in fact is what is meant by the “P part of their paper’s title“Primes in P. The “P refers to the time complexity class of algorithms that can be performed on a deterministicTuring machine in polynomial time. This was a truly great breakthrough for the field.

The breakthrough idea that has led to this algorithm again uses Fermat’s Little Theorem and thereforereinforces the importance of that theorem that has roots dating back the best part of three millennia beforethis paper was produced.

Theorem 8. Let a ∈ Z, n ≥ 2 and (a, n) = 1. Then n is prime if and only if (X + a)n = Xn + a (Mod n)

This theorem is proved in detail in the initial paper. It then forms an integral part of the algorithm whichis stated below.

AKS Primality Test Algorithm:Input: integer n > 1.i) If (n = ab for a ∈ N and b > 1), output COMPOSITE

Page 29: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 29

ii) Find the smallest r such that Or(n) > log2(n)iii) If 1 < (a, n) < n for some a ≤ r, output COMPOSITEiv) If n ≤ r, output PRIMEv) For a = 1 to [

√ϕ(r)× log(n)log(n)] do

if (X + a)n = Xn + a (Mod n)

Output COMPOSITEvi) Output PRIME

We used this algorithm to create a computer programme that would be able to implement this PrimalityTest. [Appendix N] We again used Matlab for this as to keep a consistency throughout all of our programs.However there are several complex elements to the algorithm that we found particularly difficult to programand this had some negative implications on the effectiveness of our version of the test. Our program turned outto be extremely inefficient which demonstrated our own personal limitations in terms of programming ability.We still managed to gain some results, but we were unable to use our program for high numbers as it took theprogram too long. Below you can see a graph representing the time taken for the program to run for differentvalues of n.

Figure 13: Above is the AKS Primality Test program performed up to 1000.

Page 30: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 30

Figure 14: Above is the AKS Primality Test program performed up to 10000.

As you can see instantly, both graphs have a very linear shape which is an interesting result. It says that thetime the program takes to run increases at a steady rate as n increases. It also shows that the programs takesapproximately 2.3 seconds to verify a number is prime when that number is close 10,000. This is particularlyslow for a modern day computer program, and although the program may not have been programmed mostefficiently, it also suggests that the algorithm itself is still not as time efficient as the previous probabilistic testsdiscussed before. This comparison will be discussed in more detail in the next section.

3.4 Comparison of Primality Tests

3.4.1 The Two Probabilistic Tests

It is normal to look specifically at the comparison between the Fermat Primality Test and the Miller-RabinPrimality Test as they share the most in common out of the 3 tests that we have looked at. The Miller-Rabintest has more steps and therefore any computer program implementing the test will have to perform moreoperations than a program implementing the Fermat Primality test. Therefore it is intuitive to believe thatthe Fermat test will be executed quicker than the Miller-Rabin test. We wanted to make sure that this wasthe case so we timed both tests for different values of n. We then plotted their respective graphs against eachother. The graph comparing the two of them can be seen below.

Page 31: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 31

Figure 15: Time taken to run Miller-Rabin (Green) and Fermat’s (Blue) on a list of primes upto 10,000

As both programs have a fairly straight and horizontal shape up until very large numbers, we limited thedomain of this graph to give a more zoomed in perspective of the comparison. As expected, the Miller-Rabintest takes longer to perform on a computer and will remain that way as n keeps increasing. This graph is justemphasising more clearly some of the elements we mentioned on the individual analysis of these tests.

It can be seen that the Miller-Rabin Test has a slightly bigger gradient which means as n grows, the gap be-tween the two curves also grows. This means the difference in time to perform the two tests grows as n gets larger.

3.4.2 Comparison of All Three Tests

In this section we compare all three of the Primality tests that we have looked at. We have just looked at thetwo probabilistic tests, which use the fact that they are very efficient to make up for them having a very smallchance of falsely identifying a number as being prime. The last Primality test we looked at, the AKS Primalitytest, overcame this problem by creating a deterministic algorithm.

That means the test sacrifices some efficiency in order to be 100% certain that their result is correct. There-fore we believed it would make interesting reading for all three tests to be compared to each other, where allthree are programmed by the same people and then implemented on the same machine. Below is a graph showall three tests plotted against each other.

Page 32: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 32

Figure 16: The AKS (Crosses) vs the Miller-Rabin (Green) vs the Fermat (Blue) primalty tests

The graph is again limited to just testing on the prime numbers up to 100. This is because the separationbetween the AKS graph and the other two grows rapidly and makes it particularly difficult to see what is hap-pening with both of the probabilistic tests. As the shapes of the graphs carry on in much the same direction asseen above, we felt it was justifiable to limit the domain as much as we have to fully exemplify the comparisonbetween the three.

As we saw earlier in the report, the AKS program has a very linear and consistent shape and grows ex-tremely sharply compared to both the Miller-Rabin and Fermat tests. The AKS test actually starts off beingmore efficient than the Miller-Rabin test. However the two probabilistic tests have smaller gradients and aremore consistent in terms of time as n grows. This results in the AKS test becoming far slower than the twoother tests as n grows past n = 79.

This graph is a good representation of the penalties paid in terms of efficiency in order to obtain more robusttests. Fermat’s test is the weakest and contains the most pseudoprimes and even Carmichael numbers so itis not that surprising to see that it is all the quickest. Next is the Miller-Rabin Test which is much strongerin terms of robustness, reducing the number of pseudoprimes by approximately half [25]. In order for it to bemore robust, it performs more operations and therefore takes more time. Lastly, is the deterministic AKS test.This test obviously has no pseudoprimes whatsoever and consequently it is the least efficient, as we have seenin figure 16. The AKS test also is the most complicated to understand mathematically and can prove to bedifficult to program.

3.5 Test’s Theoretical and Experimental Order

To find the experimental theoretical complexity of our algorithms we used the knowledge that the relationshipbetween time and number of operations performed is essentially constant. This meant by measuring the timetaken to perform each algorithm we could use that data to find an experimental order of complexity. We useda Matlab inbuilt function tic-toc to measure the time. It is important to remember throughout the analysis ofthis data that because the computer will be doing multiple processes at once we will not find 100% consistentdata as the CPU usage will vary at each test. We tried to negate this as much as possible by doing each testmultiple times but due to time constraints on the use of computers, we obviously weren’t able to remove thiscompletely.

Page 33: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 33

Once we had got the time taken how did we then use this to find an order of complexity. If we assumethat each test has an order of a power of logs i.e. O(log2(n)a) then we can write T = Clog2(n)a where C is aconstant and T is the time taken. By taking logs of each side we obtain this equation:

Equation 12. log2(T ) = log2(C) + alog2(log2(n))

Which corresponds to a y = mx + c graph with y = log2(T ) and x = log2(log2(n)) so if we plot log2(T )against log2(log2(n)) then the gradient will correspond to a which is the power of log that the order of com-plexity is.

3.5.1 Fermat’s Primality Test Order of Complexity

After much investigation, both from our own work and research, we were able to find the theoretical order ofcomplexity of each of the tests. This was important as we were then able to compare our experimental order ofcomplexity against what theory says it should be. For the Fermat test, the theoretical order of complexity isO(mlog2(n)) where m is the number of bases the test is performed over [10]. Below is the graph implementingthe techniques discussed in the previous section.

Figure 17: The graph of log2(log2(n)) against log2(t) for the Fermat Primality Test

The gradient of the graph in figure 17 is the power of log2(n) which is how our experimental order of com-plexity is calculated. Initially the graph looks rather awkward in terms of calculating the gradient, as there aretwo distinct linear sections which are separated by a vertical jump at approximately 5 on the log2(log2(n)) axis.As you will see below in figure 18, this also happens in our graph when we try to calculate our experimentalorder of complexity for the Miller-Rabin test. Our best explanation for this odd occurrence is that Matlabhas a threshold point where the time taken to perform calculations has a sudden rise. Clearly we have testedthe Fermat test beyond this threshold point so it is not a fair illustration of the gradient of graph. Thereforewe decided to combat this problem by only using the results up to the point before the time taken jumps up.From this we calculated an approximate gradient of 1. This is a pleasing result as it gives us the same order ofcomplexity as the theory suggests.

Page 34: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 34

3.5.2 Miller-Rabin’s Primality Test Order of Complexity

We did the same for the Miller-Rabin test. We found the theoretical order for this test to be O(klog2(n)) wherek is the number of bases the test is performed over. Below is the graph we used to calculate our experimentalorder of complexity.

Figure 18: The graph used to calculate the experimental order of complexity for theMiller-Rabin test.

In this graph we see the same occurrence of an odd jump in the time taken for the test to be performedat approximately 5 on the log2(log2(n)) axis. Therefore we have used the same method of focusing on thegraph before that point and therefore calculating the gradient from the linear section up to that point. Weapproximated the gradient to be 1. This too gives us the same result as the theoretical order of complexity.

3.5.3 The AKS Primality Test Order of Complexity

We found that the theoretical order of complexity for this Primality test was O(log1922 (n)). There have been

several alterations to the algorithm and different domains imposed on the test which can significantly reducethis order. Below is the graph that we used to calculate our experimental order of complexity.

Page 35: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 35

Figure 19: The graph of log2(log2(n)): Used to calculate the experimental order of complexity forthe AKS test.

As this graph again uses the AKS Primality Test, the domain we have used has again been limited to 100.The very first point on the graph does not fit in with the general trend of the rest of the graph and thereforewe decided to exclude it in our calculation of the gradient. We then approximated the gradient to be around6.25, close to 19

3 . This shows that experimental order of complexity is smaller than the theoretical order ofcomplexity. It should be kept in mind that the theoretical order of complexity is an upper bound. That is tosay that the test should not take longer than that theoretical order of complexity. And by that definition, thisgraph suggests that our findings look very much as they should from a mathematical standpoint.

3.6 Prime Ladders

Prime ladders are a concept used by H.A.Helfgott and David J. Platt [7] to verify the ternary version of theconjecture numerically. We have an alteration of the Miller-Rabin test that we have coded to mimic the workthey did on a much smaller scale and create a prime ladder. By combining our own numerical verificationof the binary Goldbach conjecture by our naı̈ve programs and this prime ladder, we were able to extend theverification for the ternary conjecture much further. The main idea behind prime ladders being used here isthat if you can verify the binary conjecture up to say 104, and then produce a ladder of primes in which eachrung is less than 104 apart, then for the height of that ladder you have verified the ternary conjecture. Thisis because to verify the odd numbers in between each rung you add every even number from 2 to 104 to thebottom rung and by verifying the binary conjecture (i.e. each even number is the sum of two primes), we haveverified the ternary conjecture for that range by adding a third prime.

To construct their prime ladder Helfgott and Platt used Proth numbers which are likely to be prime as youcan see in section 3 of their paper. We used a much cruder method of employing the prime testing algorithms tofind the nearest prime to 105 (the number we verified up to using our naı̈ve program) above the last rung. Thisinvolved checking for primality for each prime before that therefore was quite inefficient but it demonstratesthe idea well. You can see the code for this algorithm in [Appendix O].

For numbers up to 106 we get a ladder as such, 99991; 199967; 299951; 399941; 499927; 599927; 699863;799859; 899851; 999809; 1099807.

Page 36: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 36

It is also worth noting that our Sieve of Eratosthenes is efficient up to 108 and so creating a ladder fromthis list of primes would also be an effective way to do it for the small number we are working with. The reasonwe did it with the method of using a primes finding algorithm is because this becomes more crucial when youget to larger numbers where a sieve becomes incredibly inefficient. The algorithm was able to produce a similarladder up to 107, although any larger than that it become too inefficient, this leads quite nicely into furtherwork on Probable Primes such as Proth Primes but this is an area that we did not have time to investigate sowe couldn’t develop any better ladders than this.

So we have verified the binary conjecture up to 105 and the ternary conjecture up to 107, or 108 if youinclude the sieve.

4 Conclusion

As we conclude it will be important to remind ourselves of the problem that we set out to solve. This wasset out at the end of our introduction in Section 1.7. We conceded that solving the conjecture was clearly animpossible task for mathematicians of our ability in the time frame that we had been given. Consequently welooked around the conjecture in a wider sense and fell upon the area of primality as an area in which we couldprovide some original research and draw on some of the knowledge that we were able to pick up on from ourcurrent degrees, especially the Number Theory module. We will split our conclusions in to our Conclusion andEvaluation; the Conclusions will be again split into the two areas we looked at in our findings, sieve theoryand primality testing where the Evaluation will be split into 3 sections, an Evaluation of our Methodology, ourfindings and an Evaluation into our group’s performance in this report. We will all look at potential furtherresearch that we would do if we had more time on the report.

4.1 Conclusions on Primality Tests

We settled on programming three primality tests all in Matlab and then testing them all on the same computer.This would have given analysis on these primality tests completely independent of differences in computer hard-ware and differences in the implementation of different programming languages. This would have provided areport that collated all this analysis in one place and provided what we believe to be something that has notbeen done in this form. In our analysis of our findings we will explain in more detail some of the shortcomingsof our findings in this area but here we will explain what as a group we feel we can conclude in light of theanalysis we have gained.

The first thing we feel we can conclude is about the ease of programming of the different algorithms. Boththe Fermat and the Miller-Rabin algorithms are very easy to program and we managed to get results thatagreed with or was comparable to much of the literature that we looked at. However the AKS algorithm proveda much greater test to program, giving unexpected results. This is a small part of a much wider conclusionthat deterministic algorithms for primality are still a long way behind probabilistic algorithms in efficiency andrelevance. We have come to that conclusion based not only on our own experience but also a quick look atthe current uses of each. Languages that provide their own inbuilt primality testing functions don’t use theAKS function, but will tend to use a combination of probabilistic algorithms, in the case of Maple combiningthe Miller-Rabin test with Lucas’ Primality Test, so it was just not our own efforts in programming this testbut also it is common experience of other programmers. If this was not the case then the AKS would be usedeverywhere but this isn’t happening.

We would have like to have completely concluded from our own research which primality test was mostefficient but however we don’t feel like our evidence is strong enough due to the constraints we had while usingMatlab and the problems we came across. We can see however from our findings that the AKS test will getincreasingly slower as you get to much larger numbers of n but we were unable to use large enough numbersto fully support that conclusion. Additional support for this conclusion comes from the work we did on findingthe order of complexity experimentally for each test. You can see from the analysis in section 3.5 that the orderof complexity for both the Fermat and the Miller-Rabin test which we calculated seem to be of very similarorders i.e. O(n) ∼ log2(n), however the AKS was of a much larger order i.e. O(n) ∼ log2(n)

193 , As shown in

our findings these results are mostly backed up by the theoretical order of complexity and so can be consideredhelpful for our conclusion.

Page 37: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 37

4.2 Conclusions on Sieves

The Sieve of Eratosthenes was proved to be a very useful tool, in finding the set of Goldbach partitions of aneven number. Its simplicity makes it easy to modify it and use it to tackle different problems. So using thissieve method, we managed to create fairly simple and efficient programs in order to find the set of Goldbachpartitions of even integers greater than 2 and calculate the size of this set. During our research we often cameacross the set A = {(p, 2N − p) ∈ P 2;

√2N < p < 2N −

√2N} which is the set of the Goldbach partitions

in the interval I = (√

2N, 2N −√

2N) as well as its size [13][12]. This raised the question, why do the Sievemethods and researchers in general focus on the Goldbach partitions of this interval instead of all the Goldbachpartitions, however we didn’t find an answer in the original papers. Using Matlab we were able to show thatthe size of A is non-zero for all even numbers greater than 2 and up to 100, 000. Furthermore we have shownthat on average for 2N up to 100,000, 98.3% of the Goldbach partitions are in the interval I. This justifies whythere is particular interest on this subset of the set of the Goldbach partitions of a number. The scatter plotswith the number of the Goldbach partitions, show a general increasing tendency in the number of Goldbachpartitions and there are no numbers with zero number of partitions, thus up to 2N = 100, 000 we have evaluatedthe Goldbach conjecture and all of these numbers have Goldbach partitions in the interval I.

4.3 Evaluation

In order to evaluate our report we need to look back to our evaluation strategy in our Project Plan this is givenbelow:

“Possibly the hardest part of this project, aside from the level of mathematical knowledge needed to under-stand all the current and past work done on the conjecture, is knowing how successful we have been in our report.If we look back at our aims and objectives one of the big objectives is to understand some of the theory behindhow people have gone about trying to solve this conjecture and similar problems. This level of mathematics, assuggested before, is quite possibly above what we are able to achieve. However we will be able to use our currentnumber theory knowledge base and build on that by our own learning as part of this project to understand conceptscurrently much further than the scope of our degree. The main way we can test if we have effectively understoodthese concepts is to be able to teach them to our peers and explain them to our supervisor/lecturers. One waywe can do that is to hand out small parts of the report to our peers to see if they can understand what we havewritten and get verbal feedback from them. Our final group presentation will be another great way to test this outand we will start, as you can see in our Methodology, preparing that before finishing writing our final report inorder to include how easy or hard we find making that presentation. On top of this the very act of being able towrite up a report of this nature requires sufficient understanding of the concepts covered so we will be able to talkabout our experience on conveying those concepts in our report and consequently how much we understood aboutthem. This will involve us being honest in our evaluation but as the marker of the report will have the ability tounderstand the mathematics contained in it they will be able to see if that evaluation is true. Another big part ofour aims is to improve our initial naı̈ve programs to verify for larger numbers by looking at current verificationattempts. This is a lot easier to evaluate as we will have quantifiable results which we can check. It will producea number for which we have been able to verify the conjecture up to, also we will be able to see how efficientlywe have done that and so extrapolate how far we could verify it up to if we had designated CPU processing time.”

As you can see from this evaluation strategy one of our main aims was “to understand some of the the-ory behind how people have gone about trying to solve this conjecture and similar problems.” To do this, assuggested in our project plan, we gave sections of our report to some of our fellow students of varying degreedisciplines in order to see if we have been able to communicate what we have learnt well enough in our report.The evaluation of this feedback is done in section 4.3.3. We have evaluated our methodology in section 4.3.1and the evaluation of our findings is done throughout our findings section.

In our evaluation strategy we then discussed being honest about our experience of writing the report andpreparing the final presentation, and from this how we have understood the project. As a whole we found writ-ing up the mathematical parts of the report fairly easy, having spent a long time researching and understandingthe material, the compiling of the report went fairly smoothly, likewise with the writing of the presentation.We did have a few problems with writing the conclusions as we couldn’t conclude what we were hoping to butthis was only a slight problem. We concluded what we could and felt the conclusions we gave were valid andworthwhile despite being different to what we had hoped.

Another aim for our project was to improve on the current naı̈ve program that we had made, you cansee in the introduction that we managed to make small improvements by drawing on Leo’s work into sieves

Page 38: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 38

however due to the change of course of our project we were unable to make any more significant updates.We did however manage to use the work on primality tests to do make our own small prime ladder foundin section 3.6. This extended the verification that we had done with our naı̈ve program to a larger numberfor the ternary conjecture so we were able to improve on the work we had done but not in the way we had hoped.

4.3.1 Evaluation of Methodology

In order to evaluate the group methodology, it was necessary to refer back to the original project plan that hadbeen formulated during the first two weeks of the project. In particular, it is necessary to look at the tasksthat had been set out, and to evaluate whether these tasks had been completed as intended. This allows usto assess to what extent the group stuck to the original plan, and to analyse which deviations were made and why.

In the original project plan (which has been reproduced here, with the addition of a ‘Was the plan fulfilled?’column), the tasks are assigned to either the ’computational team’, the ‘theoretical team’, or both. At thispoint, the computational team consisted of Alan, Barry, Charlotte and Matt, while the theoretical team con-sisted of Ally, Leo, Haonan and Sai. Ultimately, these team compositions had to be altered very early duringthe project, which will be discussed in more depth later in this section.

Figure 20: Table of Tasks in Project Plan

The date of the final presentation was unknown at this time, hence why the date stated here was not thedate that the presentation actually took place.

As can be evidenced from this table, the majority of the tasks were completed in the time period allotted asset out in the methodology. However, there were certain goals that had considerable setbacks, or that presentedunexpected difficulties, and in these cases it was necessary to reconsider our strategy.

Perhaps the largest setback the group faced was the sudden illness of a group member that began in week2, before the project plan was complete. As mentioned in the methodology, this meant that she was unable to

Page 39: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 39

contribute any work to the project throughout the following weeks. Thus, the group was forced to consider a lessrigid approach regarding who would perform the computational and theoretical tasks outlined in the plan. Leoin particular focussed considerably on programming the algorithms he had researched into the topic of Eratos-thenes’ sieve. This also placed larger pressure on Alan and Barry, who programmed the primality algorithms asanalysed in the ‘Findings’ section. Ultimately, the group managed to successfully overcome the setback of havingone less team member, though this inevitably placed limitations on the amount of work that could be performed.

Regarding the research performed into the Hardy-Littlewood method, Waring’s problem and other relatedtheorems, in hindsight it was naı̈ve to assume that these tasks would be completed in mid-late October, assuggested originally, given that these two areas are very expansive with many far-reaching applications, andin addition required mathematical knowledge beyond that required for an undergraduate degree. This meantthat much more time and resources were necessary to fulfil research in these areas than the group had initiallyanticipated in fact, this research continued until as late as week 9. Consequently, there were fewer peopleavailable to contribute to the other aspects of the report than anticipated, which was a major roadblock whencombined with the aforementioned absence. Research into primality testing in particular suffered, and the pro-cess of writing the introduction did not begin until late week 7, a later than ideal start. While the remainingtasks were completed within the allotted time, these setbacks placed greater pressure on the group, and thiswas at times difficult to account for.

The one other goal that was not completed as intended was the plan to improve the naı̈ve verificationprograms that had been made at the project’s earliest stages, and improve them using the research that hadbeen collected over the weeks. Ultimately, the initial naı̈ve programs had used Eratosthenes’ sieve, which asmentioned previously is very effective for evaluating the conjecture for values of n up to 10,000,000. Given theresources that were available to us, it was simply not feasible for a more sophisticated verification program to bemade, because the primality tests that were analysed only become noticeably more effective than Eratosthenes’sieve for very large n. The computers that were used for this project were not powerful enough to handlenumbers of this size, and consequently we discovered that the goal we had set out of improving these programswas inherently unachievable with the constraints that we faced.

4.3.2 Evaluation of Findings

We evaluated our findings as we went along in the findings section as it seemed a more sensible approach thantrying to evaluate it here and having to refer continually back to the findings section.

4.3.3 Evaluation of Group performance

In order to gain feedback on our report, it was decided that one sample section of the report would be shownto a number of students, and they would fill in a survey detailing to what extent the section was clearly laidout and understandable. The section chosen was the introduction, because this was the section that requiredthe largest amount of abstract number theory in order to complete.

The participants of the survey mostly consisted of mathematics students (including one that had taken theNumber Theory module), but also included students in fields such as accounting, and civil and environmentalengineering. The feedback received was positive, the majority of responses agreed that the introduction waswell-structured and sufficiently detailed, and that the text sections were, for the most part, easy to follow. How-ever, almost all responses noted that there were certain parts that were difficult to understand, in particular,the sections focussing on summations. However, most stated that these difficulties stemmed from a lack ofknowledge in the area of number theory, rather than a lack of clarity in the introduction itself.

Ultimately, this feedback was affirmative. It is not surprising that most responses found certain sectionshard to understand the mathematics required to investigate the conjecture are beyond those utilised within anundergraduate degree, and thus it would be unrealistic to expect undergraduate students (especially those whodo not take mathematics) to be able to understand all of it. Beyond this, the consensus seemed to be that theintroduction was solidly written and researched, and laid out appropriately.

4.4 Future Research

In an ideal world we could say that given the knowledge we now have we would go on to prove Goldbach’sconjecture but this is obviously absurd given who has tried and failed in the past.

Page 40: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 40

Our report has left a number of other avenues for potential further research. One of the first things to dobefore any further research however is to ensure we have implemented the AKS time graph correctly. Oncethat is done as a group we felt using Matlab significantly restricted or increased the difficulty of this report,so changing to a faster language and ensuring we have full use of very large integer arithmetic would be theobvious next step for our report. This would lead to the report we first envisaged when setting out, somethingthat could properly analyse each primality test in the independent way he had hoped. Extending the samerigorous approach to other primality tests would also be a credible option for further research. We also believethat research into a statistical approach to the Goldbach partitions would be a viable option and although it isnot sufficient to prove the conjecture it can give direction to other future theoretical research.

Page 41: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 41

5 Appendices

5.01 Appendix A: 1st Sieve of Eratosthenes

5.02 Appendix B: 2nd Sieve of Eratosthenes

5.03 Appendix C: Goldbach Partitions

Page 42: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 42

5.04 Appendix D: Number of Goldbach Partitions

5.05 Appendix E: Goldbach Comet

5.06 Appendix F: Average Ratio of Goldbach Partitions

Page 43: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 43

5.07 Appendix G: 1st Naı̈ve Programme

5.08 Appendix H: 1st Sieve

Page 44: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 44

5.09 Appendix I: 2nd Sieve

5.10 Appendix J: 2nd Naı̈ve Programme

Page 45: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 45

5.11 Appendix K: Fermat Test

5.12 Appendix L: Mod Squaring

5.13 Appendix M: Miller Rabin Test

Page 46: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 46

5.13 Appendix N: AKS Test

Page 47: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 47

5.13 Appendix O: Prime Ladders

Page 48: Goldbach Conjecture Report

ECM3735: Maths Group Project 5 - The Goldbach Conjecture 48

References

[1] A.A.Fraenkel, Integers and theory of numbers, DoverPublications.com, 1955.

[2] K. Asaf, Introduction to the hardy-littlewood circle method rational points seminar, Notes from HebrewUniversty available at: http://www.math.huji.ac.il/∼asafk/notes/circle method.pdf.

[3] D.Baczkowski, Applications of the hardy-littlewood circle method, available athttp://home.wlu.edu/∼baczkowskid/talks/number theory/waring3.pdf.

[4] D.M.Burton, Elementary number theory, (2005), 79.

[5] G.E.Andrews, Euler’s pentagonal number theorem, Mathematics Magazine 56 (1983), no. 5, pp. 279–284(English).

[6] H.A.Pogorzelski, Goldbach conjecture, J. reine angew. Math 292 (1977), 1–12.

[7] HA Helfgott and David J Platt, Numerical verification of the ternary goldbach conjecture up to 8.875 e30,arXiv preprint arXiv:1305.3062 (2013).

[8] J.D’Errico, Variable precision integer arithmetic, avaliable at: https://www.mathworks.co.uk/matlabcentral/fileexchange/22725-variable-precision-integer-arithmetic.

[9] J.Wu, Chen’s double sieve, goldbach’s conjecture and the twin prime problem, 2, arXiv preprintarXiv:0709.3764 (2007).

[10] M.Agrawal, Primality tests based on fermats little theorem, Distributed Computing and Networking,Springer, 2006, pp. 288–293.

[11] M.Agrawal, N.Kayal, and N.Saxena, Primes in p, Annals of mathematics (2004), 781–793.

[12] M.B.Villarino, Mertens’ proof of mertens’ theorem, arXiv preprint math/0504289 (2005).

[13] M.Mathis, A short formal proof of goldbach’s conjecture, available athttp://milesmathis.com/gold4.html.

[14] P.J.Giblin, Primes and programming, Cambridge University Press, 1993.

[15] P.Pollack, On hilberts solution of warings problem, Central European Journal of Mathematics 9 (2011),no. 2, 294–301.

[16] R.C.Vaughan and T.D.Wooley, Warings problem: a survey, Number theory for the millennium 3 (2002),301–340.

[17] R.G.E.Pinch, The carmichael numbers up to 1015, Mathematics of Computation 61 (1993), no. 203, 381–391.

[18] T.O.e Silva, Goldbach conjecture verification, avaliable at: http://sweet.ua.pt/tos/goldbach.html.

[19] T.O.e Silva, S.Herzog, and S.Pardi, Empirical verification of the even goldbach conjecture, and computationof prime gaps, up to 4x1018, inMath.Comp(2013).

[20] S.J.Miller and T.Ramin, An invitation to modern number theroy, Princeton University Press, Princeton,NJ, 2006.

[21] R.Heath-Brown T.Browning, Sieves in number theory.

[22] V.Bryant, Aspects of combinatorics: A wide-ranging introduction, Cambridge University Press, 1993.

[23] W.Liang, H.Yan, and D.Zhi-Cheng, Fractal in the statistics of goldbach partition, arXiv preprintnlin/0601024 (2006).

[24] Y.Wang, The goldbach conjecture, World Scientific Publishing Co., Singapore, 2002, Pages used: 1-4 99-101.

[25] Z.S.McGregor-Dorsey, Methods of primality testing, MIT Undergraduate Journal of Mathematics 1 (1999),133–141.