The Sieve of Eratosthenes: An Ancient Greek Method of Finding Primes

in #math6 years ago

Throughout mathematical history, thinkers have attempted to come up with a great many methods by which to discover prime numbers. Eratosthenes' was perhaps the simplest.

Eratosthenes (c. 276 - 195 B.C.) was an important Greek thinker - a philosopher, astronomer, mathematician and poet - who produced some very important work which followed up on many of his most notable Greek predecessors, such as Aristotle and Euclid.


image credit

Perhaps Eratosthenes' most famous contribution to early thought was his shockingly accurate measurement of the circumference of the Earth (yes, they knew that the Earth was round even 1700 years before Columbus); a measurement he performed by calculating the angle of the sun's shadow at the same time of day at two different locations on the Earth and analyzing the minute difference between them. His methods may seem somewhat primitive but his results were nothing short of astonishing (though just how accurate he was is not precisely known, for the units of measurement he used are outdated and their exact length is uncertain).

Somewhat more overlooked than Eratosthenes' measurement of the Earth, however, was his rather fascinating and wholly simple creation which aided in analyzing one of the most fascinating subjects in all of number theory - Prime Numbers.


image credit

Creating the Sieve

A prime number, of course, is merely a number which cannot be divided by any number other than itself and 1. Three, five, seven, eleven, and thirteen are all examples of prime numbers, and while it is rather simple to determine the primacy of these relatively low integers, the questions become profoundly more difficult as the numbers get higher.

Certain questions regarding primes have always been difficult, due to the fact that even today a method has not yet been discovered to determine whether or not a given number is genuinely prime without going through the motions of actually trying to divide it by every smaller number. So even a simple question can actually prove to be remarkably time consuming when discussing prime numbers. A prime (no pun intended) example of this is a question such as: How many prime numbers are their below 100?

While Eratosthenes would not discover a method of instantly discovering an answer to a question such as this, he was able to develop a rather interesting little trick which aids in the process, and which is simple enough that even those who are not intimately familiar with number theory can understand it.

To begin with, Eratosthenes began with a simple table of numbers, such as a 10 x 10 table which covered every number between one and one hundred.

From here, discovering every prime number below one hundred is just a simple process of elimination. Every number which is not a prime number was crossed off, one by one.

Using the Sieve

To use his sieve, Eratosthenes first crossed off the number one, which is certainly not a prime number. Then, beginning with the number 2, Eratosthenes crossed off every multiple of that number; 4, 6, 8, 10, all the way up to 96, 98 and 100. Because all of those numbers are divisible by 2, they cannot be prime numbers.

Next, Eratosthenes moved up to the next lowest number which was not yet crossed off, which is 3. Then, he went through and crossed off every multiple of 3 to be found in the table; 6, 9, 12 . . . 96, 99. Only 34 numbers are left which are not crossed off.

Now he skips the number four (which is already crossed off) and moves up to the next prime, 5, and crosses off all of its multiples. 28 possible primes left.

Now multiples of 7, leaving 25 primes. And that is it. With just seven steps all of the non-primes are crossed off of the list and only the primes remain. All the numbers between 1 and 100 have passed through the sieve and only the primes have come out the other side.

Further Implications of the Sieve

In addition to providing a convenient method for finding the number of primes within a certain range by way of a very simple table and a process of elimination, the Sieve of Eratosthenes can also be changed and adapted - resized and reshaped - in order to discover some very fascinating patterns which begin to crop up in the distribution of prime numbers.

In addition, it becomes clear when using the sieve for larger numbers that as the numbers grow higher and higher, prime numbers grow few and far between, though they certainly continue to exist (it has been proved at many times and in many different ways that there does not exist a "highest" prime number - there will always be more). The sieve allows a fascinating look into the extreme difficulties to be found in attempting to mathematically quantify the distribution of prime numbers - a subject which has fascinating the minds of even the greatest mathematicians for more than two and a half millennia.

A Great Sieve of Eratosthenes Resource

"Eratosthenes." The University of Utah http://www.math.utah.edu/~alfeld/Eratosthenes.html

Sort:  

This is a really cool method! Here is an implementation of it I put together in octave for a course earlier this year:

function [list] = primeList (n)

isPrime = ones(1,n); % one is not prime
isPrime(1,1) = 0;
list = [];

for i = 2:n
if(isPrime(1,i) == 1)
    list = horzcat(list,i);
    for j = (i^2):i:n
           isPrime(1,j) = 0;
    end
  end
end

end

Congratulations @haig! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

prime numbers are fascinating.

I have to admit that your answer is much more cheerful than the immutable diatribe that I just committed to the blockchain. Thanks for the comic relief! follow me @recreacionesdulc vote post

Congratulations @haig, this post is the sixth most rewarded post (based on pending payouts) in the last 12 hours written by a Dust account holder (accounts that hold between 0 and 0.01 Mega Vests). The total number of posts by Dust account holders during this period was 3291 and the total pending payments to posts in this category was $763.89. To see the full list of highest paid posts across all accounts categories, click here.

If you do not wish to receive these messages in future, please reply stop to this comment.

This is a cool trick to expose prime numbers.

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.033
BTC 62379.78
ETH 3034.69
USDT 1.00
SBD 3.78