质数是大于1的自然数,只有1和它本身两个因数。前几个质数是:2, 3, 5, 7, 11, 13, 17, 19, 23, 29... 2是唯一的偶数质数。要检验n是否是质数,只需验证n不能被√n以内的任何质数整除。埃拉托色尼筛法是找出给定数以内所有质数的高效方法。质数在密码学和信息安全方面有重要应用。
数学7 min readApril 2, 2026
How to Find Prime Numbers: Sieve of Eratosthenes and Other Methods
Learn multiple methods to identify prime numbers — from trial division to the ancient Sieve of Eratosthenes — with worked examples and a complete prime list up to 100.
Topics:prime numbersnumber theorysieve of eratosthenesfactors
试用免费计算器
无需注册