About Prime Numbers
About Prime Numbers
Twin Primes Conjecture
June 17, 2013 in IB Maths, IGCSE, Real life maths | Tags: how are prime numbers distributed, primes, teaching
mathematics, twin prime
How Are Prime Numbers Distributed? Twin Primes Conjecture
Thanks to a great post on the Teaching Mathematics blog about getting students to conduct an open ended
investigation on consecutive numbers, I tried this with my year 10s – with some really interesting results. My
favourites were these conjectures:
1) In a set of any 10 consecutive numbers, there will be no more than 5 primes. (And the only set of 5 primes is
2,3,5,7,11)
2) There is only 1 example of 3 consecutive odd numbers all being primes – 3,5,7
(You can prove both in a relatively straightforward manner by considering that a span of 3 consecutive odd numbers will always
contain a multiple of 3)
These are particularly interesting because the study of the distribution of prime numbers is very much a live
mathematical topic that mathematicians still work on today. Indeed studying the distribution of primes and
trying to prove the twin prime conjecture are important areas of research in number theory.
The twin prime conjecture is one of those nice mathematical problems (like Fermat’s Last Theorem) which is
very easy to understand and explain:
It is conjectured that there are infinitely many twin primes – ie. pairs of prime numbers which are 2 away from
each other. For example 3 and 5 are twin primes, as are 11 and 13. Whilst it is easy to state the problem it is
very difficult to prove.
However, this year there has been a major breakthrough in the quest to answer this problem. Chinese
mathematician Yitang Zhang has proved that there are infinitely many prime pairs with gap N for some N less
than 70,000,000.
This may at first glance not seem very impressive – after all to prove the conjecture we need to prove there
are infinitely many prime pairs with gap N = 2. 70,000,000 is a long way away! Nevertheless this mathematical
method gives a building block for other mathematicians to tighten this bound. Already that bound has been
reduced to N <60,744 and is being reduced almost daily.
Prime Number Distribution --Associated with research into twin primes is also a desire to understand the
distribution of prime numbers. Wolfram have a nice demonstration showing the cumulative distribution of
prime numbers (x axis shows total integers x100)
Indeed, if you choose at random an integer from the first N numbers, the probability that it is prime is
approximately given by 1/ln(N).
For more reading on twin primes and Yitang Zhang’s discovery, there is a great (and detailed) article
in Wired on this topic.
A discussion about the Million Dollar Maths problems (which includes the Riemann Hypothesis).
What is a prime number? How can you find prime numbers? What's the 'Sieve of
Eratosthenes'? How can you decide if a number is prime? What's the largest known prime?
A prime number is a positive integer that has exactly two positive integer factors, 1 and itself. For example, if
we list the factors of 28, we have 1, 2, 4, 7, 14, and 28. That's six factors. If we list the factors of 29, we only
have 1 and 29. That's two factors. So we say that 29 is a prime number, but 28 isn't.
Another way of saying this is that a prime number is a positive integer that is not the product of two smaller
positive integers.
Note that the definition of a prime number doesn't allow 1 to be a prime number: 1 only has one factor,
namely 1. Prime numbers have exactly two factors, not "at most two" or anything like that. When a number
has more than two factors it is called a composite number.
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, etc.
The Sieve of Eratosthenes
Eratosthenes (275-194 B.C., Greece) devised a 'sieve' to discover prime numbers. A sieve is like a strainer that
you use to drain spaghetti when it is done cooking. The water drains out, leaving your spaghetti behind.
Eratosthenes's sieve drains out composite numbers and leaves prime numbers behind.
To use the sieve of Eratosthenes to find the prime numbers up to 100, make a chart of the first one hundred
positive integers (1-100):
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100
2. Circle 2, because it is the smallest positive even prime. Now cross out every multiple of 2; in other
words, cross out every second number.
3. Circle 3, the next prime. Then cross out all of the multiples of 3; in other words, every third number.
Some, like 6, may have already been crossed out because they are multiples of 2.
4. Circle the next open number, 5. Now cross out all of the multiples of 5, or every 5th number.
Continue doing this until all the numbers through 100 have either been circled or crossed out. You have just
circled all the prime numbers from 1 to 100!
There are various primality tests, from very simple to very complex, which allow you to determine if a given
number is prime. You can read more about them at Primality Testing in our Selected Answers.
There is no largest prime number, but the effort to find ever-larger primes is ongoing and you can read about The Largest Known
Primes on the Web.
Contents:
1. Introduction
An integer greater than one is called a prime number if its only positive
divisors (factors) are one and itself. For example, the prime divisors of 10
are 2 and 5; and the first six primes are 2, 3, 5, 7, 11 and 13. (The first
10,000, and other lists are available). The Fundamental Theorem of
Arithmetic shows that the primes are the building blocks of the positive
integers: every positive integer is a product of prime numbers in one and
only one way, except for the order of the factors. (This is the key to their
importance: the prime factors of an integer determines its properties.)
The ancient Greeks proved (ca 300 BC) that there were infinitely many primes and that they were irregularly
spaced (there can be arbitrarily large gaps between successive primes). On the other hand, in the nineteenth
century it was shown that the number of primes less than or equal to n approaches n/(ln n) (as n gets very
large); so a rough estimate for the nth prime is n ln n (see the document "How many primes are there?")
The Sieve of Eratosthenes is still the most efficient way of finding all very small primes (e.g., those less than
1,000,000). However, most of the largest primes are found using special cases of Lagrange's Theorem from
group theory. See the separate documents on proving primality for more information.
In 1984 Samuel Yates defined a titanic prime to be any prime with at least 1,000 digits [Yates84, Yates85].
When he introduced this term there were only 110 such primes known; now there are over 1000 times that
many! And as computers and cryptology continually give new emphasis to search for ever larger primes, this
number will continue to grow.
If you want to understand a building, how it will react to weather or fire, you first need to know what it is
made of. The same is true for the integers--most of their properties can be traced back to what they are made
of: their prime factors. For example, in Euclid's Geometry (over 2,000 years ago), Euclid studied even perfect
numbers and traced them back to what we now call Mersenne primes.
"The problem of distinguishing prime numbers from composite numbers and of resolving the latter into their
prime factors is known to be one of the most important and useful in arithmetic. It has engaged the industry
and wisdom of ancient and modern geometers to such an extent that it would be superfluous to discuss the
problem at length... Further, the dignity of the science itself seems to require that every possible means be
explored for the solution of a problem so elegant and so celebrated." (Carl Friedrich Gauss, Disquisitiones
Arithmeticae, 1801)
See the FAQ for more information on why we collect these large primes!
The largest known prime has almost always been a Mersenne prime. Why Mersennes? Because the way the
largest numbers N are proven prime is based on the factorizations of either N+1 or N-1. For Mersennes the
factorization of N+1 is as trivial as possible--a power of two!
The Great Internet Mersenne Prime Search (GIMPS) was launched by George Woltman in early 1996, and has
had a virtual lock on the largest known prime since then. This is because its excellent free software is easy to
install and maintain, requiring little of the user other than watch and see if they find the next big one and
maybe win some EFF prize money!
Any record in this list of the top ten is a testament to the incredible amount of work put in by the
programmers, project directors (GIMPS, Seventeen or Bust, Generalized Fermat Search...), and the tens of
thousands of enthusiasts!
Click here to see the one hundred largest known primes. You might also be interested in seeing the graph of the size of record
primes by year: throughout history or just in the last decade.
The Ten Largest Known Twin Primes
See also the page: The top 20: twin primes,
and the glossary entry: twin primes.
Twin primes are primes of the form p and p+2, i.e., they differ by two. It is conjectured, but not yet proven,
that there are infinitely many twin primes (the same is true for all of the following forms of primes). Because
discovering a twin prime actually involves finding two primes, the largest known twin primes are substantially
smaller than the largest known primes of most other forms.
whe
rank prime digits who comment
n
1290000
1 2996863034895·2 -1 388342 L2035 2016 Twin (p)
666669
2 3756801695685·2 -1 200700 L1921 2011 Twin (p)
333333
3 65516468355·2 -1 100355 L923 2009 Twin (p)
222225
4 12770275971·2 -1 66907 L527 2017 Twin (p)
200006
5 70965694293·2 -1 60219 L95 2016 Twin (p)
200003
6 66444866235·2 -1 60218 L95 2016 Twin (p)
198800
7 4884940623·2 -1 59855 L4166 2015 Twin (p)
195000
8 2003663613·2 -1 58711 L202 2007 Twin (p)
173372
9 191547657·2 -1 52199 L5116 2020 Twin (p)
173250
10 38529154785·2 -1 52165 L3494 2014 Twin (p)
Click here to see all of the twin primes on the list of the Largest Known Primes.
Note: The idea of prime twins can be generalized to prime triplets, quadruplets; and more generally, prime k-tuplets. Tony Forbes
keeps a page listing these records.
Mersenne primes are primes of the form 2p-1. These are the easiest type of number to check for primality on
a binary computer so they usually are also the largest primes known. GIMPS is steadily finding these
behemoths!
ran wh
prime digits when comment
k o
1 282589933-1 24862048 G16 2018 Mersenne 51??
2 277232917-1 23249425 G15 2018 Mersenne 50??
3 274207281-1 22338618 G14 2016 Mersenne 49??
4 257885161-1 17425170 G13 2013 Mersenne 48?
5 243112609-1 12978189 G10 2008 Mersenne 47
6 242643801-1 12837064 G12 2009 Mersenne 46
7 237156667-1 11185272 G11 2008 Mersenne 45
8 232582657-1 9808358 G9 2006 Mersenne 44
ran wh
prime digits when comment
k o
9 230402457-1 9152052 G9 2005 Mersenne 43
10 225964951-1 7816230 G8 2005 Mersenne 42
See our page on Mersenne numbers for more information including a complete table of the known Mersennes. You can also help fill
in the gap by joining the Great Internet Mersenne Prime Search.
Euclid's proof that there are infinitely many primes uses numbers of the form n#+1. Kummer's proof uses
those of the form n#-1. Sometimes students look at these proofs and assume the numbers n#+/-1 are always
prime, but that is not so. When numbers of the form n#+/-1 are prime they are called primorial primes.
Similarly numbers of the form n!+/-1 are called factorial primes. The current record holders and their
discoverers are:
Primorial
rank prime digits who when comment
1 1098133#-1 476311 p346 2012 Primorial
2 843301#-1 365851 p302 2010 Primorial
3 392113#+1 169966 p16 2001 Primorial
4 366439#+1 158936 p16 2001 Primorial
5 145823#+1 63142 p21 2000 Primorial
6 42209#+1 18241 p8 1999 Primorial
7 24029#+1 10387 C 1993 Primorial
8 23801#+1 10273 C 1993 Primorial
9 18523#+1 8002 D 1989 Primorial
10 15877#-1 6845 CD 1992 Primorial
Factorial
ran whe
prime digits who comment
k n
101584
1 208003!-1 p394 2016 Factorial
3
2 150209!+1 712355 p3 2011 Factorial
3 147855!-1 700177 p362 2013 Factorial
4 110059!+1 507082 p312 2011 Factorial
5 103040!-1 471794 p301 2010 Factorial
6 94550!-1 429390 p290 2010 Factorial
7 34790!-1 142891 p85 2002 Factorial
8 26951!+1 107707 p65 2002 Factorial
9 21480!-1 83727 p65 2001 Factorial
10 6917!-1 23560 g1 1998 Factorial
ran whe
prime digits who comment
k n
Click here to see all of the known primorial, factorial and multifactorial primes on the list of the largest known primes.
A Sophie Germain prime is an odd prime p for which 2p+1 is also prime. These were named after Sophie
Germain when she proved that the first case of Fermat's Last Theorem (xn+yn=zn has no solutions in non-zero
integers for n>2) for exponents divisible by such primes. Fermat's Last theorem has now been proved
completely by Andrew Wiles.
whe
rank prime digits who comment
n
Click here to see all of the Sophie Germain primes on the list of Largest Known Primes.
P. Ribenboim, The new book of prime number records, 3rd edition, Springer-Verlag, New York, 1995. (QA246 .R472).
P. Ribenboim, The little book of bigger primes, Springer-Verlag, New York, 2004. (A less mathematical version of the above
text.)
H. Riesel, Prime numbers and computer methods for factorization, Progress in Mathematics volume 126, Birkäuser Boston,
1994.
R. Crandall and C. Pomerance, Prime numbers: a computational perspective, Springer-Verlag, New York, 2001. ISBN 0-387-
94777-9.
See also [Bressoud89] and [Cohen93] on the page of partially annotated prime references. Also of interest is the Cunningham
Project, an effort to factor the numbers in the title of the following book.
J. Brillhart, et al., Factorizations of bn±1 b = 2,3,5,6,7,10,11,12 up to high powers , American Mathematical Society, 1988
[BLSTW88].Top 20 Provers
Chris K. Caldwell- caldwell@[Link]- Mathematics & Statistics University Tennessee at Martin - Copyright 2020
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139,
149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223,
227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293,
307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383,
389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463,
467, 479, 487, 491, 499, ...
Hi. What is the fastest way to determine if a number is prime? I thought of dividing that number by up to half
of it but I'm sure there is a better way.
-Doctor Wilkinson, The Math Forum Check out our web site! [Link]
-Doctor Wilkinson, The Math Forum Check out our web site! [Link]
Frequency of Primes
Date: 03/17/97 at [Link]
From: Jonah Knobler
Subject: Frequency of Primes
I am a student in an Algebra II class, and I'm wondering about number theory. I know what a prime number is,
and I believe there are an infinite number of them (someone HAS proved this, right?)
Is there any discernible pattern in the frequency of prime numbers? For instance, the distance between
primes starts as:
1 (2->3)
2 (3->5)
2 (5->7)
4 (7->11)
2 (11->13)
4 (13->17)
2 (17->19)
4 (19->23)
6 (23->29)
2 (29->31).
This sequence seems to have no pattern, but it is only a VERY small part of the sequence. My question is this:
knowing that, as you continue toward greater primes, the distance between primes (usually) increases, is
there a general trend in HOW this distance increases? Does it approximately follow a
quadratic/logarithmic/linear/whatever function? Is it completely random? What does it look like on a
graph?
Seeing how important prime numbers are in number theory, I would assume that discovering an interesting
number or formula popping up here (e.g. pi, e, etc.) would be fascinating.
Thanks!
- Jonah Knobler
-Doctor Rob, The Math Forum Check out our web site! [Link]
I am fairly new to teaching 7th grade math. We have been studying prime and composite numbers. I have
had little difficulty explaining that "2" is a prime number and that "1" is neither prime nor composite.
Then one bright student asked about the number"0." I was stumped and have not been successful at finding a
solution. So, is "0" prime, composite, or neither?
Thanks!
Andy Cotton
It is neither. It is not prime - lots of other numbers divide into it.(They all do, except for zero itself). But it is
not composite – the only way you could get zero by multiplying primes together is if one of the primes were
zero, which isn't the case. Often when defining prime and composite numbers, the fact that the number must
be greater than one is part of the definition.
-Doctor Jeremy, The Geometry Forum
No Largest Prime Number
Date: 8/19/96 at [Link]
From: Anonymous
Subject: Largest Prime Number
What's the largest prime number?
Thanks in advance for your answer,
Xander from the Netherlands
This is a very interesting number, because whenever you divide it by a prime number (that is, whenever you
divide it by a pN) you get a remainder of 1. But what it means to be a prime number is exactly that it has no
prime numbers that divide into it evenly. So "Q" is prime, or has prime factors larger than pL.
The situation now is that by assuming there are only a limited number of prime numbers we can show that
there must others not in the original list. This is obviously impossible, so our original assumption is false, too.
That means then that there must be an infinite number of primes and that there is no largest prime.
The proof method I have used here is called "Proof by contradiction "or "reductio ad absurdum" in Latin, and it
is very commonly used in mathematics and philosophy. You assume the opposite of what you really want to
prove, and then show an absurdity to which this assumption leads when it is carried to its logical conclusion.
Pretty useful!
Primality Test
Date: 11/26/2001 at [Link]
From: Maria
Subject: Prime numbers
I want to write a program using Pascal, and I am required to enter any number in my program, which should then say if
it is a prime number or not. I want to know if there is any formula for prime numbers.
1,48
2,24
3,16
4,12
6,8
The key is to notice that all of the first numbers occur before sqrt(48). If the number had been 49, I would
write the divisors as:
1,49
7,7
Here one of the divisors is sqrt(49).
So what we notice is that if a number n has a divisor greater than one (which would make the number a non-
prime), it must be less than or equal to sqrt(n).
So you just need to run a for loop that tests to see if any number from 3 (clearly you don't need to test 2 - if
the number is even and greater than two, it can't be prime) up to sqrt(n) divides evenly into the given number.
If you find one, then the number isn't prime. If you don't find one, the number is prime.
So how do you test divisibility? Why don't you try looking at the remainder when you divide your number n by
3, 4, 5, etc...
If you ever get a remainder of zero, then you have found a factor and the number isn't prime.
I don't know about pascal, but c++ has a modulus operator (the % symbol) that returns the remainder when
you divide a by b. For example:
22%7 would return 1 because 22 is one more than a multiple of 7.
If pascal has a similar command, this is the way to go. Otherwise, you'd have to be a bit more sly. If you are
testing the number 77 for primality (it isn't prime since 77 = 7*11) and, say, you are up to 77/5
Have the computer write this as a decimal:
77/5 = 15.4
What you want to have the computer do is check to see if the number has a non-zero part after the decimal.
So first run an until loop that subtracts one from the number until it is less than one and bigger than or equal
to zero.
In the case above, the computer would stop when the number was .4
Now test to see if this number is zero. If it is zero, then you've found a factor and the number isn't prime.
Otherwise you conclude that this particular divisor didn't divide evenly into the number being tested, so you
increase the divisor by one and try again.
There are other - probably better - ways to test for divisibility as well. But this should at least give you a start.
I hope this helps. Please write back if you'd like to talk about this some more.
I'm working on a prime number tester, and I was taking a look through your articles, when I noticed that one
of your answers to a patron involved what to do if you had no modulus function. You told him to create a loop
to subtract 1 from the division of the problem until it was less than one, then test if it was equal to 0. Instead,
most of the programming languages will include some sort of flooring or rounding down function, like C++ in
the math.h library. Therefore, you could make an IF statement to test "(X/Y)=FLOOR(X/Y)".
For example, if you wanted to test if 10 was evenly divisble by three. 11/3 = 3.667, and FLOOR(10/3) = 3.
Since the two are not equal, 3 is not a divisor of 10, and you can move on to the next number. However,
testing 12 and 3, you get 12/3 = 4, and FLOOR (12/3) = 4. Since the two are equal, 4 is a divisor of 12, and you
can stop.
I hope this helps you, and maybe some other person out there in the world. Thanks for all your help over the
years, Dr. Math.
Actually, all you need a language to support is integer division (or, equivalently, the ability to convert a "real"
or "floating point" number to an integer, which will do essentially what "floor" does). For your purposes,
merely testing divisibility, your suggestion is good; one might write it as if (a/b = int(a/b)) // a is divisible by b
if "int" converts a number to an integer. In fact, you can even write a "mod" function using this: mod(a, b) = a
- b * int(a/b)
This will be zero when a is divisible by b, and otherwise will be the remainder.
All of this ignores some problems when either number is negative; I've dealt with that elsewhere, but you
wouldn't need it in dealing with primes.
What is Mod?
[Link] If you have any further questions, feel free to write back.
- Doctor Peterson, The Math Forum [Link]
Now, the number 1 is a problem. I've heard people say that it's prime, since you can divide it by 1 without
getting a fraction. I've also heard people say that it has its own little category, because a prime number should
be divisible by two numbers: 1 AND itself, and nothing else; and since 1 is one, you can only divide it by 1
number without getting a fraction. I'd ask your teacher whethershe thinks it's prime or not, but it doesn't
really matter, at least not when you're doing prime factorization.
All prime factorization is, is taking a composite number and splitting it up into the little numbers that it's made
up of until you can't split it up any more. Take the number 8, for example. We can divide 8 into 2 and 4.
8
/\
2 4 But we're not done yet; 4 can be split
into 2 and 2
/\
2 2 Now we're done.
If you draw the smaller pieces (called the factors) in an upside down tree, like I just did, you can go back and
collect all the pieces at the ends of the branches, and they will be the "prime factors" of the number. So, the
prime factors of 8 are 2, 2, and 2.
Here's another example: 30
30
/ \
5 6
/\
2 3
2--every even number is divisible by 2; if a number ends in a 2, 4, 6, 8, or 0, at least one of its factors will be a
2.
3--if you add the digits of a number, and the number you get is divisible by 3, then the original number is
divisible by 3. For instance, if you take the number 57, and you add the digits, 5+7=12, and since 12 is
divisible by 3, 57 is divisible by 3; 3 is a factor of 57.
4--take the last 2 digits of the number. If they are divisible by 4, then
the number is divisible by 4. 216, for example, is divisible by 4, because
16 is divisible by 4.
5--anything that ends in a 5 or a 0 is divisible by 5.
6--anything that is divisible by 2 and by 3 is divisible by 6. Can you
figure out why?
7--Somebody once told me that there was a shortcut to finding out if a
number was divisible by 7, but she said that it would take just as long to
walk to the store and buy a calculator as to use it, so it really wasn't
much of a short-cut.
8--If the last 3 digits of the number are divisible by 8, the number is
divisible by 8.
9--If the sum of the digits of the number is divisible by 9, then the
number is divisible by nine.
10--If a number ends with a 0, it's divisible by 10.
12--If a number is divisible by 3 and by 4, it's divisible by 12. Can you
figure out why?
Those are all of the short-cuts to finding factors that I know. If you
have any more questions, or if any of this doesn't make sense to you,
write back to us!
For summaries, see "Divisibility Rules" and "Explaining 3, 9, 11, 7, 13, 17,
and larger numbers":
[Link] [Link]
-Dr. Elizabeth The Math Forum Check out our Web site! [Link]
The Lucas-Lehmer test is a way of seeing whether a number of this form really is prime or not. All the really
large primes that are known are Mersenne primes, because the Lucas-Lehmer test makes it easy (relatively
speaking) to determine whether numbers of this form are prime or not. Nobody knows whether there is an
infinite number of Mersenne primes. Currently 36 or 37 have been discovered. The test works as follows:
Relative Primes
Date: 11/24/97 at [Link]
From: Athena
Subject: Relative Primes
What IS relatively prime? I have some homework with no basic instructions other than using these numbers: 8, 9, 11, 12,
14, 15, 21, 24, 25, 28 to answer the questions below. The first one goes: Which numbers are relatively prime to 4? Then
Which numbers are relatively prime to 6? and so on.....
I also have other questions of my own... can two even numbers be relatively prime? How about odd?
We have been working on factors and have never touched on "relatively prime." What is the connection between
factors and relatively prime?
Thank you,
Athena