eratosthenes
As we all know that the prime number is an integer greater than 1 which is only divisible by 1 or itself. For example 2,3,5,7,11,.. etc. The value of N is given by the user. Before going to solve this problem, we will learn a little bit about the Sieve of Eratosthenes and it's an algorithm.
众所周知, 素数是大于1的整数,只能被1或自身整除。 例如2、3、5、7、11等。N的值由用户指定。 在解决此问题之前,我们将学习有关Eratosthenes筛网的知识 ,这是一种算法。
What is the Sieve of Eratosthenes?
什么是Eratosthenes筛?
It is a simple and ancient method for finding all Prime numbers less than or equal to N.
查找所有小于或等于N的素数是一种简单而古老的方法。
Algorithm to find Prime numbers by Sieve of Eratosthenes
通过Eratosthenes的Sieve查找素数的算法<