0% found this document useful (0 votes)
750 views21 pages

About Prime Numbers

Uploaded by

Meliza Advincula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
750 views21 pages

About Prime Numbers

Uploaded by

Meliza Advincula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

How Are Prime Numbers Distributed?

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)

Twin Prime Conjecture

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).

We can see other patterns by looking at prime arrays:

This array is for the first 100 integers –


counting from top left to right.  Each black
square represents a prime number.  The
array below shows the first 5000 integers. 
We can see that prime numbers start to
“thin out” as the numbers get larger.

The desire to understand the distribution of


the prime numbers is intimately tied up
with the Riemann Hypothesis – which is one
of the million dollar maths problems.  Despite being conjectured by
Bernhard Riemann over 150 years ago it has still to be proven and so remains one of the most important
unanswered questions in pure mathematics.

For more reading on twin primes and Yitang Zhang’s discovery, there is a great (and detailed) article
in Wired on this topic.

If you enjoyed this topic, you may also like:

A post on synesthesia about how some people see colours in their numbers.

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.

Here are the first few prime numbers:

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

1. Cross out 1, because it is not prime.

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.

Ask Dr. Math ®


© 1994-2020 The Math Forum at NCTM. All rights reserved.
[Link]
The Largest Known Primes
A quick summary of the 5000 largest
A historic Prime Page resource since 1994!
Last modified: [Link] AM December 15 2020 UTC

Contents:

1. Introduction (What are primes? Who cares?)


2. The Top Ten Record Primes:
    largest, twin, Mersenne, primorial & factorial, and Sophie Germain
3. The Complete List of the Largest Known Primes
4. Other Sources of Prime Information
5. External: Euclid's Proof of the Infinitude of Primes

   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!

  2. The "Top Ten" Records


A. The Ten Largest Known Primes
See also: The top 20: Largest Known 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!

rank prime digits who when comment

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

9 10223·231172165+1 9383761 SB12 2016

10 230402457-1 9152052 G9 2005 Mersenne 43

           

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.

C. The Ten Largest Known Mersenne Primes


See also the page: The top 20: Mersenne primes,
and Mersenne primes (history, theorems and lists).

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.

D. The Ten Largest Known Factorial/Primorial Primes


See also the Top20: primorial and factorial primes,
and the glossary entries: primorial, factorial.

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.

E. The Ten Largest Known Sophie Germain Primes


See also the page: The top 20: Sophie Germain,
and the glossary entry: Sophie Germain Prime.

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

1 2618163402417·21290000-1 388342 L927 2016 Sophie Germain (p)

2 18543637900515·2666667-1 200701 L2429 2012 Sophie Germain (p)

3 183027·2265440-1 79911 L983 2010 Sophie Germain (p)

4 648621027630345·2253824-1 76424 x24 2009 Sophie Germain (p)

5 620366307356565·2253824-1 76424 x24 2009 Sophie Germain (p)

6 1068669447·2211088-1 63553 L4166 2020 Sophie Germain (p)

7 99064503957·2200008-1 60220 L95 2016 Sophie Germain (p)

8 607095·2176311-1 53081 L983 2009 Sophie Germain (p)

9 48047305725·2172403-1 51910 L99 2007 Sophie Germain (p)

10 137211941292195·2171960-1 51780 x24 2006 Sophie Germain (p)

           

Click here to see all of the Sophie Germain primes on the list of Largest Known Primes.

   3. Other Sources of Large Primes


Because of the lag time between writing and printing, books can never keep up with the current prime records
(that is why this page exists!)  However books can provide the mathematical theory behind these records
much better than a limited series of web pages can.  Recently there have been quite a number of excellent
books published on primes and primality proving.  Here are some of my favorite:

 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

Finding Prime Numbers


Date: 12/5/95 at [Link]
From: Anonymous
Subject: prime numbers

What is the easiest way to find a prime number?

Date: 12/14/95 at [Link]


From: Doctor Ken
Subject: Re: prime numbers
Hello!
Actually, it can pretty hard to figure out whether a given number is prime. In fact, the toughest secret codes in
the world rely on the fact that it's really hard (even for a computer) to factor big numbers. These are numbers
that have somewhere around 30 digits.
For smaller numbers, it's a little easier to figure out, but you basically have to go through your list of known
prime numbers (2,3,5,7,11,13,...) and check to see whether any of them divide the number you have. It can
get pretty slow, but it's pretty easy and it works. There are some faster (and much harder!) ways to do it,
but they don't always work.
Here are all the prime numbers up to 500:

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, ...

-Doctor Ken, The Geometry Forum [Link]


Finding Prime Numbers
Date: 11/10/97 at [Link]
From: Ulric Cajuste
Subject: How to determine if a number is prime

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.

Date: 11/11/97 at [Link]


From: Doctor Wilkinson
Subject: Re: How to determine if a number is prime
You don't have to go as far as half the number. The square root of the number will do, because if for example
n has a factor d greater than the square root of n, then n/d will be less than the square root of n.
There are many more sophisticated methods for determining whether a number is prime without actually
factoring it. Especially for very large numbers, these are a lot faster than just trying to find factors. I can give
you more details if you're interested.

-Doctor Wilkinson, The Math Forum Check out our web site! [Link]

Date: 11/11/97 at [Link]


From: Ulric Cajuste
Subject: Re: How to determine if a number is prime
Yes, I'm interested in more sophisticated ways to determine prime numbers. Thanks for your time.
Ulric

Date: 11/11/97 at [Link]


From: Doctor Wilkinson
Subject: Re: How to determine if a number is prime
The most common way to check whether or not a large number is primeis known as the Miller-Rabin test. This
has the interesting propertythat if it tells you the number is composite, then it is definitely composite, though
it won't tell you any of the factors. If it doesn't tell you the number is composite, however, it only tells you that
it is probably prime. The degree of certainty is very high, however. If you need to be absolutely sure, there are
fancier tests you can use, but I don't have the details. In most practical applications, 99.999% certain is good
enough.
Here's how it works: let N be the number you want to test, and let N - 1 = 2^s * t, where t is odd.
This is easy to calculate. You just keep dividing by 2 until you get an odd number.
Pick a number < N at random. You can keep repeating the test for different values of a. The more values of a
you use, the more certain the result.
Now all the arithmetic you do from here on out is going to be mod N. That is, you always take the remainder
from dividing by N after every operation. You start the process by letting u = a^t
That is, you take the t'th power of u, taking the remainder mod N after every multiplication. (There are
shortcuts to doing this power operation so that you don't have to actually multiply t times: this is
important when you are looking at very large numbers.)
Now if u is 1, you conclude that N is probably prime. To make sure, try some more values of a.
If u isn't 1, then you keep squaring u (don't forget to keep taking the remainder mod N). If you hit 1 without
hitting N-1 first, you can definitely conclude that the number is composite. Otherwise, you again
conclude that the number is probably prime, and you can try another value of a to be more certain.

-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

Date: 03/18/97 at [Link]


From: Doctor Rob
Subject: Re: Frequency of Primes
The Proof of the Infinite Number of Primes:
This was done by Euclid more than 2000 years ago. He used a proof by contradiction.
Suppose p(1), ..., p(n) is a list of all the prime numbers, i.e., that there are only finitely many. Then construct
the number N = p(1)*p(2)*...*p(n) + 1.
By the Fundamental Theorem of Arithmetic, this can be uniquely written as a product of prime numbers. If
p(i) is one of those prime numbers, then N = p(i)*M, and so: 1 = N - p(1)*...*p(n) = p(i)*[M - p(1)*...*p(i-
1)*p(i+1)*...*p(n)], which demonstrates that p(i) is a prime divisor of 1. This is, of course, impossible, since p(i)
> 1. Thus none of the prime divisors of N appears in the list of primes. This contradicts the assumption that the
list contained all primes. The conclusion is that no such list is complete, and the number of primes must be
infinite.
Is there a pattern for the distribution of prime numbers?
This is a problem which has interested number theorists for several centuries. There is no discernible pattern
known. Even such simple questions as, "Does 2 appear infinitely often?" are unresolved. This particular
question is known as the "Twin Prime Conjecture." Some facts are known, however. For example, it is known
that there is an infinite subsequence {x(n): n=1, 2, ...} of the prime numbers such
That [x(2*n) - x(2*n-1)]/log_e[x(2*n)] is unbounded (gets bigger than any number you pick in advance). This
(and more) was proved by Paul Erdos in 1949.
>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.
Yes, wouldn't it. Notice the appearance of e in the previous paragraph! Pi, e, and Euler's constant gamma
frequently do appear in formulae or theorems involving prime numbers. For example, there is a theorem
which says that if you pick two integers at random (in some sense which I won't go into), that the probability
that they have no common prime divisor is 6/pi^2 ~=~ 0.6079271, which I think is really pretty!
These are important and interesting questions in number theory, many of which are unsolved. It is heartening
to see an Algebra II student with interest in them. Keep up the good questions!

-Doctor Rob, The Math Forum Check out our web site! [Link]

Is Zero Prime or Composite?


Date: 10/23/95 at [Link]
From: Andrew Cotton
Subject: 7th Grade Math Question

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

Date: 11/5/95 at [Link]


From: Doctor Jeremy
Subject: Re: 7th Grade Math Question

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

Date: 8/21/96 at [Link]


From: Doctor Mike
Subject: Re: Largest Prime Number
Hello Xander,
The answer to your question is that there is NO largest prime number.
There is a pretty easy proof of this fact. Suppose temporarily that there are only a finite number of prime
numbers. The smallest one would be 2, the next is 3, then come 5, 7, 11 and so on. We could give them
symbolic names like p1 = 2, p2 = 3, p3 = 5, p4 = 7, p5 = 11, etc. Because we are temporarily assuming that
there is only a certain finite number of them, let pL stand for the biggest one of them all. Remember we are
assuming that p1, p2, ... pL is the COMPLETE list.
From these prime numbers, imagine another VERY large number that you would get by multiplying all these
"L" prime numbers together and then adding one. In symbols it is :
Q = (p1)*(p2)*(p3)*(p4)*(p5)*(p6)*...*(pL) + 1

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!

I hope this helps.

-Doctor Mike, The Math Forum


Check out our web site! [Link]

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.

Date: 11/26/2001 at [Link]


From: Doctor Paul
Subject: Re: Prime numbers
This is a problem that mathematicians have been working on solving for thousands of years. There are some
special types of primality tests that require some pretty advanced mathematics. But I think the most basic test
is as follows:
First notice that all of the divisors of a number come in pairs:
For example, if I pick 48 its divisors are:

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.

- Doctor Paul, The Math Forum [Link]

Date: 02/08/2006 at [Link]


From: Josh
Subject: More convienent Prime Number Testing - no modulus
My question isn't a question, so much as a helpful tip to you, Dr. Math. Your database of answers has helped
me through the years with many of my problems, so I would like to contribute back if I can.

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.

Date: 02/08/2006 at [Link]


From: Doctor Peterson
Subject: Re: More convienent Prime Number Testing - no modulus
Hi, Josh.
You're right that the suggested workaround is about as inefficient as you can get; probably Dr. Paul was
offering an alternative that could work in the most basic language imaginable, and didn't even want to assume
it had a floor function.

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]

Date: 02/22/2006 at [Link]


From: Josh
Subject: Thank you (More convienent Prime Number Testing - no modulus)
Hey, I didn't even think of that! You're right about the whole negative numbers thing, and I understand the
idea of working with the simplest language possible. Thanks for your comments and suggestions!
- Josh
Prime Factorization
Date: Thu, 26 Jan 1995 [Link] AST
From: Richard Seguin
Subject: Prime Factorization
Could one of you guys give me a crash course on Prime Factorization. We just started that Section at school today, and
since I come from a different province, I know nothing about it. In class they can divide so quickly, is there a trick to
dividing 2 numbers so quickly?

Date: 26 Jan 1995 [Link] -0500


From: Elizabeth Weber
Subject: Re: Prime Factorization
Hello there!
Prime factorization is pretty simple once you know what's going on, and it's fun too! I used to do it in the
margins of my notebooks when I was bored in class.
Every whole number can be put into one of two categories: prime or composite. Prime numbers are numbers
that you can't divide without getting a fraction, unless you feel like dividing them by themselves or by 1.
These are numbers like 3, or 5, or 7, or 19, or 379721 (I told you I used to do this when I was bored!).
Composite numbers, on the other hand, can be split up into something smaller; 8 is 2 times 4, 4 is 2 times 2,
21 is 3 times 7, 100 is 5 times 5 times 2 times 2, and so on. Thus, 8, 4, 21, and 100 are all composite numbers.
It's easy to remember which word means which--composite has the word compose in it, and you can make
composite numbers out of smaller numbers just like you can compose a piece of music out of smaller sounds.

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

So, the prime factors of 30 are 2, 3, and 5.

Now, you wanted to know some tricks of dividing:

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]

Prime Number Information


Date: 15 Apr 1995 [Link] -0400
From: Andy Cook
Subject: Prime numbers
Prime numbers fascinate me, but information about them is hard to find. Could you please tell me;
1) What is the largest prime number that has been discovered?
2) Who found it? and when?
3) What are the theories that are used when searching for prime numbers?
4) What is the formula? :-)
5) What is the connection between prime numbers and encryption?
Andy Cook

Date: 15 Apr 1995 [Link] -0400


From: Dr. Ken
Subject: Re: Prime numbers
Hello there!
1) The largest prime number known is 2^859433 - 1.
2) I believe it was discovered and verified by Cray Research in 1994.
3) Basically, you have to look at specific forms that prime numbers can take, rather than just looking at big
numbers and trying to factor them. Prime numbers of the form 2^n - 1 are called Mersenne primes, named for
Marin Mersenne, who was one of the folks interested in them back in the 1640's. We know this about them:
(a) in order for 2^n - 1 to be prime, n has to also be prime. (b) If n is prime, then 2^n - 1 is only divisible by
primes of the form 2*k*n + 1 if it's divisible at all.
So you can see that instead of having to go through and check our number 2^859433 - 1 for divisibility by all
primes, we only have to check divisibility by 2*1*859433 + 1 = 1718867 2*2*859433 + 1 = 3437733
and so on. Note that these numbers also have to be prime, so we can check their primality first before trying
to divide them into 2^859433 - 1.
4) There can be no polynomial formula in n that will give you all primes as a function of n. Basically, we've
been reduced to using a lot of these special cases of primes to see whether we can figure out some big primes.
5) Briefly, here's how it works. You have a really big number that's the product of two big primes. Since it's
really hard to factor numbers when they're big (yes, even for a computer), you can tell people what the big
number is, but you don't tell them what its factors are. Then people use the big number to encode a message,
and you need to know the factors to decode it. (I admit I'm a little fuzzy on exactly how this works, since
someone is borrowing my number theory book)
If you want more information on primes and you can access the World Wide
Web, check out
[Link] which has a lot of information about big primes.
-Ken "Dr." Math
Prime Number Theorems
Date: 01/03/99 at [Link]
From: Alisa Levine
Subject: Prime Numbers
Hi. I have to write a math paper on prime numbers. I have a few questions. First of all, what exactly is the prime number
theorem? Is there a way to provide a description in a simpler way to describe it? I know that it has to do with finding
primes and proving primality. Also, what is the Lucas-Lehmer test for Mersenne primes, and how do Mersenne primes
differ from other primes? What's the Riemann Hypothesis?
Thank you in advance for your time and your responses.
Alisa Levine

Date: 01/04/99 at [Link]


From: Doctor Wilkinson
Subject: Re: Prime Numbers
The Prime Number Theorem provides an approximate answer to the question "how many prime numbers are
there between 1 and n?" The answer is: "about n/ln(n)" where ln(n) means the natural logarithm of n, which
is the power you need to raise the number e to to get n. (e is about 2.718281828).
A Mersenne prime is a prime of the form 2^n - 1. You can show by simple algebra that a number of this form
can be prime only if n is also a prime.

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:

You let p be a prime and let n = 2^p - 1. Let:


S_1 = 4
S_{k+1} = (S_k)^2 - 2 if k >= 1

Then n is prime if and only if S_{p-1} is divisible by n.


Explaining the Riemann Hypothesis in simple terms is harder, because you need to know about infinite series
and about complex numbers. This is about as simple as I know how to make it:
The function zeta(s), known as the Riemann Zeta Function, is defined for complex numbers s for which the real
part of s is greater than 1, by the series: zeta(s) = sum(1/n^s) n = 1, ..., infinity
The definition can be extended by a process known as analytic continuation to all complex values of s, except
for s = 1. (We say that zeta(s) has a simple pole at s = 1). It is fairly easy to prove that zeta(s) is zero when s is a
negative even number. The Riemann Hypotheses states that all the other zeroes of zeta(s) have imaginary part
equal to 1/2. This is the most famous remaining unsolved problem in all of mathematics. Its importance for
prime numbers is that if it is true, then we can estimate the number of primes between 1 and n
more accurately.
- Doctor Wilkinson, The Math Forum [Link]

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

Date: 11/25/97 at [Link]


From: Doctor Terrel
Subject: Re: Relative Primes
Dear Athena,
In simple terms, two (or more) numbers are said to be relatively prime if their "GCF" (greatest common factor)
is 1.
My favorite teaching example is to use 14 and 15, about which I am quick to point out that "Neither
of them is prime, but taken as a pair, they are relatively prime numbers. Proof? The factors of 14 are 1, 2, 7,
and 14. The factors of 15 are 1, 3, 5, and 15. The greatest common factor (in fact the only one) they share is
one (1)." End of story.
Actually you've been using the idea of relatively prime numbers every time you reduce a fraction to
its lowest terms. For example, 15/22 is in lowest terms because there is no number that is a common factor
(other than 1) by which we can divide the numbers 15 and 22.
Now your homework should make some sense. Okay?

-Doctor Terrel, The Math Forum


Check out our web site! [Link]

Why is 1 Not Considered Prime?


Date: 20 Mar 1995 [Link] -0500
From: Ian Oostindie
Subject: Why 1 is prime
Just recently a grade six student asked me "Why is 1 not considered prime?" I tried to answer but could not,
since I do not understand this either. I thought the explanation might lie in the fact that "we" don't use the
true definition or we are interpreting it wrong. A prime is normally described as a number that can be
expressed by only one and itself. We exclude all non-natural numbers from the set that we will be working on
and then everything is fine except for when we work with 1.
1 = 1 x 1. That is, one equals 1 times itself and there is
no other combination.
Now to the grade six student in Faro Yukon, I said there may be a small print clause in the contract with the
math gods that says you can only write it once, since 1 also equals 1x1x1x1x... This would not work for other
primes such as two: 2 does not equal 1x2x2x2x... Likewise, 3 does not equal 1x3x3x3x...
Patterns are very important to mathematics, I further explained, and this is a pattern I see being broken. I
showed this in a slightly different way to the grade sixer but in essence the same.
My question to you, Dr. Math, is what is the small print in the contract with the Math gods and how do we
explain it to the grade six kids who are supposed to know it?
Thank you very much for any consideration you make.

Date: 25 Mar 1995 [Link] -0500


From: Dr. Ken
Subject: Re: Why 1 is prime
Hello there!
Yes, you're definitely on the right track. In fact, it's precisely because of "patterns that mathematicians don't
like to break" that 1 is not defined as a prime. Perhaps you have seen the theorem (even if you haven't, I'm
sure you know it intuitively) that any positive integer has a unique factorization into primes. For instance,
4896 = 2^5 * 3^2 * 17, and this is the only possible way to factor 4896. But what if we allow 1 in our list of
prime factors? Well, then we'd also get 1 * 2^5 * 3^2 * 17, and 1^75 * 2^5 * 3^2 * 17, and so on. So really, the
flavor of the theorem is true only if you don't allow 1 in there.
So why didn't we just say something like "a prime factorization is a factorization in which there are no factors
of 1" or something? Well, it turns out that if you look at some more number theory and you accept 1 as a
prime number, you'd have all kinds of theorems that say things like "This is true for all prime numbers except
1" and stuff like that. So rather than always having to exclude 1 every time we use prime numbers, we just say
that 1 isn't prime, end of story.
Incidentally, if you want to call 1 something, here's what it is: it's called a "unit" in the integers (as is -1). What
that means is that if we completely restrict ourselves to the integers, we use the word "unit" for the numbers
that have reciprocals (numbers that you can multiply by to get 1). For instance, 2 isn't a unit, because you can't
multiply it by anything else (remember, 1/2 isn't in our universe right now) and get 1. This is how we
think about things in Abstract Algebra, something sixth graders won't need to worry about for a long time, but
I thought I'd mention it.
-Ken "Dr." Math

Date: 05/01/2002 at [Link]


From: Anonymous
Subject: 1/2 not in our universe?
Reading the explanation of why 1 isn't prime, I came across the sentence "Remember, 1/2 is not in our universe right
now." What does this mean?

Date: 05/01/2002 at [Link]


From: Doctor Peterson
Subject: Re: 1/2 not in our universe?
This reflects the condition previously given, "if we completely restrict ourselves to the integers...". That means
that we are only considering the integers, and not thinking about any other kind of number; the set of objects
under consideration is called the "universe." Any object not in that universe does not exist, as far as the
problem at hand is concerned. In this case, since the reciprocal of 2 is 1/2, but 1/2 is not an integer, we say
that 2 _does not have_ a reciprocal, and thus is not a "unit."
- Doctor Peterson, The Math Forum
[Link]

The first 100 primes are


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 503 509
521 523 541.

You might also like