New Take on an Ancient Method Improves Way to Find Prime Numbers (2024)

September 24, 2016

4 min read

New Take on an Ancient Method Improves Way to Find Prime Numbers

The modified version of the sieve of Eratosthenes could accelerate computer calculations

By Matías Loewy

New Take on an Ancient Method Improves Way to Find Prime Numbers (1)

Peruvian mathematician Harald Helfgott gained worldwide attention in 2013 when he solved a 271-year-old problem: the so-called Goldbach’s weak conjecture, according to which every odd number greater than 5 can be expressed as the sum of three prime numbers—such as: 3 + 3 + 5 = 11 and 19 + 13 + 3 = 35.

But Helfgott, 38, went even farther back in time and conceived an improved version of the sieve of Eratosthenes, a popular method for finding prime numbers that was formulated circa 240 B.C. Helfgott’s proposed version would reduce the requirement of physical space in computer memory, which in turn would reduce the execution time of programs designed to make that calculation.

Prime numbers are something like “atoms of mathematics,” which can only be divided by themselves and the number 1. Eratosthenes of Cyrene—a Greek mathematician, astronomer and geographer who was director of the Library of Alexandria and became famous for calculating the circumference of Earth—also proposed a practical method to identify them: the “sieve,” or filter. “Like many other children, I was taught this it in primary school when I was 10, with a table,” says Helfgott, who is currently a researcher at the National Center for Scientific Research (CNRS) and the University of Göttingen.

On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.

In order to determine with this sieve all primes between 1 and 100, for example, one has to write down the list of numbers in numerical order and start crossing them out in a certain order: first, the multiples of 2 (except the 2); then, the multiples of 3, except the 3; and so on, starting by the next number that had not been crossed out. The numbers that survive this procedure will be the primes. The method can be formulated as an algorithm and computers can quickly run it.

While working on correcting tests for a book with the full demonstration of Goldbach's weak conjecture, Helfgott says he began thinking—“maybe for too much time”—about the problem of the sieve of Eratosthenes. In particular, about its requirement of space or memory. "Computers today are very fast and can also perform calculations in parallel. But the memory is still limited," Helfgott explains.

Mathematician Jean Carlos Cortissoz Iriarte, of Cornell University and Los Andes University, says that in order to know how good an algorithm is, one has to consider two factors: the number of operations per bit given an input (for example, 100) and the number of bits to be stored in memory while the instructions are executed. “In terms of the number of operations per bit to be performed, the sieve of Eratosthenes is relatively efficient. It grows in proportion to the size of the interval considered. But if you look at what needs to be kept in memory for each step of the algorithm performed for large intervals [numbers], then the sieve stops being efficient,” he says.

Now, inspired by combined approaches to the analytical 100-year-old technique called the circle method, Helfgott was able to modify the sieve of Eratosthenes to work with less physical memory space. In mathematical terms: instead of needing a space N, now it is enough to have the cube root of N. “To calculate all primes up to a trillion, the modified version of the sieve requires a few million bits instead of a billion bits,” Helfgott says. The main ideas of the proposal were presented in July both at the XXI Latin American Colloquium of Algebra, held in Buenos Aires, and at Sinapsis 2016, a confab of Peruvian scientists residing in Europe, held in Paris.

To understand the advantage of the new sieve, Cortissoz offers an analogy. “Let's pretend that you are a computer and that to store data in your memory you use sheets of paper. If to calculate the primes between 1 and 1,000,000, you need 200 reams of paper (10,000 sheets), and with the algorithm proposed by Helfgott you will only need one fifth of a ream (about 100 sheets),” he says.

Although reducing the space requirement generally implies certain “minor” sacrifices in the theoretical speed of the algorithm, Helfgott believes that in certain ranges the deficit could be offset or exceeded by the possibility of mainly or exclusively using the cache memory—which is smaller but faster than main memory or RAM. “It depends on the application,” he says.

There are other sieves or algorithms to identify prime numbers. But Helfgott notes the sieve of Eratosthenes is different in that it also can workwith other mathematical operations such as factorization—a technique that breaks down any number in the product of prime numbers and is the basis of cryptographic methods for encoding information in a safe way, such as for conducting electronic bank transfers or online purchases. “Factoring has become a key element of contemporary civilization,” Helfgott says. Eratosthenes would never have imagined it.

New Take on an Ancient Method Improves Way to Find Prime Numbers (2024)

FAQs

What is the ancient method for finding prime numbers? ›

Sieve of Eratosthenes is a simple and ancient algorithm used to find the prime numbers up to any given limit. It is one of the most efficient ways to find small prime numbers. For a given upper limit n the algorithm works by iteratively marking the multiples of primes as composite, starting from 2.

Who developed an easy method to find prime numbers? ›

Sieve of Eratosthenes is a method to find the prime numbers and composite numbers among a group of numbers. This method was introduced by Greek Mathematician Eratosthenes in the third century B.C.

Which method is used to find prime numbers? ›

Finding Prime Numbers Using Factorization

Step 1: First find the factors of the given number. Step 2: Check the number of factors of that number. Step 3: If the number of factors is more than two, it is not a prime number.

What is the trick to find prime numbers? ›

To find whether a larger number is prime or not, add all the digits in a number, if the sum is divisible by 3 it is not a prime number. Except 2 and 3, all the other prime numbers can be expressed in the general form as 6n + 1 or 6n - 1, where n is the natural number.

What is the history behind prime numbers? ›

In about 200 BC the Greek Eratosthenes devised an algorithm for calculating primes called the Sieve of Eratosthenes. There is then a long gap in the history of prime numbers during what is usually called the Dark Ages.

What is the most efficient way to calculate prime numbers? ›

Sieve Method:

This method is considered to be the most efficient method to generate all the primes smaller than the given number, n. It is considered as the fastest method of all to generate a list of prime numbers.

Is there an algorithm to find prime numbers? ›

Most algorithms for finding prime numbers use a method called prime sieves. Generating prime numbers is different from determining if a given number is a prime or not. For that, we can use a primality test such as Fermat primality test or Miller-Rabin method.

Who found the easy method to identify prime numbers from 1 to 100? ›

By the sieve of Eratosthenes, we have 25 prime numbers and 75 composite numbers between 1 to 100. Eratosthenes sieve method is the easiest way to find prime numbers from given many numbers.

Is there a way to predict prime numbers? ›

But until now, we have not been able to predict where the next prime will pop up in a sequence of numbers. In fact, mathematicians have generally agreed that prime numbers are like weeds: they seem just to shoot out randomly.

What is the logic for prime numbers? ›

A natural number is said to be prime if it is only divisible by itself and 1. In short, a prime number has only two factors that are 1 and the number itself. The numbers that are not prime are called composite numbers. A prime number can be written as a product of only two numbers.

Is there a pattern to find prime numbers? ›

Until now, there is no known efficient formula for primes, nor a recognizable pattern or sequence the primes follow. All recent publications dealing with this issue established that primes are distributed at random and looked more to a white noise distribution [7] .

How do you find prime numbers for dummies? ›

A prime number is a number that can only be divided by itself and 1 without remainders. What are the prime numbers from 1 to 100? The prime numbers from 1 to 100 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. Why is 1 not a prime number?

What is the formula for the prime numbers? ›

Each prime number can be written as 6n + 1 or 6n – 1 (with the exception of the products of indivisible numbers, for example 2, 3, 5, 7, 11), where n is a characteristic number an n > 3.

What is the algorithm for finding prime numbers? ›

Normal Prime Number Algorithm:

To check whether a given number N is prime or not, We have to check if number is divisible by any number from 2 to N-1. If it is not divided by any number then it is a prime number else it is not a prime number.

What is the method for generating prime numbers? ›

Prime sieves

A prime sieve works by creating a list of all integers up to a desired limit and progressively removing composite numbers (which it directly generates) until only primes are left.

Which mathematician gave the method to find prime and composite numbers? ›

The Sieve of Eratosthenes is used to identify prime numbers and composite numbers. We will discuss in detail the topic and find the prime numbers from 1 to 100. By the sieve of Eratosthenes, we have 25 prime numbers and 75 composite numbers between 1 to 100.

Top Articles
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 6179

Rating: 5 / 5 (60 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.