Skip to content

beihai-official/PrimeNumProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Prime Number Generator 🟢

一个用 Python 实现的质数生成器,支持多种算法和大范围质数生成,可视化进度条,支持保存结果到文件。


功能特点

  • 普通判断质数:从 1 开始判断质数
  • 平方根优化算法:只遍历到平方根,提高效率 300 倍
  • 埃拉托斯特尼筛法:快速筛选大范围质数
  • 大范围质数保存:可选择将质数保存到文件,避免刷屏
  • 进度条可视化:实时显示质数生成进度

使用方法

安装依赖

pip install rich

运行脚本

python prime_generator.py

个人签名

 _            _  _             _
| |__    ___ (_)| |__    __ _ (_) _ __ ___    ___ 
| '_ \  / _ \| || '_ \  / _` || || '_ ` _ \  / __|
| |_) ||  __/| || | | || (_| || || | | | | || (__ 
|_.__/  \___||_||_| |_| \__,_||_||_| |_| |_| \___|

About

This is a Python-based prime number generator that calculates all primes within a specified range. 🚀 It supports progress display using the `rich` library and offers an option to save results to a file. 📈 Perfect for math enthusiasts and algorithm studies! 🎉

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages