- Original Research: This project was originally developed in March 2024.
- Restoration: These files were restored and archived on GitHub in 2026 to preserve the research.
- Documentation: This README and the file mappings were generated with the assistance of AI. While every effort was made to categorize the logic accurately, some minor mismatches in file mapping or descriptions may exist compared to the original 2024 intent.
Thank you for visiting the archive!
A comprehensive collection of algorithms and mathematical proofs dedicated to the discovery, verification, and visualization of Perfect Numbers and Mersenne Primes. This repository spans the evolution of number theory research, from classic trial division to high-performance deterministic tests like Lucas-Lehmer and AKS.
To navigate the 19-file collection, the repository is organized by computational logic:
/primes: Foundational primality testing (Trial Division, Wilson’s Theorem, AKS)./generators: Master scripts for discovering Mersenne Primes and Perfect Numbers./verifiers: Tools for checking specific candidates and benchmarking accuracy./high-performance: Optimized, silent, and batch-processing scripts for large-scale searches./visualization: Geometric mapping of prime distributions (Ulam Spiral).
| Filename | Category | Logic Used | Speed / Notes |
|---|---|---|---|
dp.1.py |
Trial Division |
|
Practical for general-purpose prime lists. |
dpp3.py |
Wilson's Theorem | Theoretical; limited by |
|
P.1.py |
Library Baseline | Miller-Rabin & Lucas Tests | Gold Standard. Used for verification. |
P.2.py |
Divisor Summation | Brute Force ( |
Targeted at 33,550,336 (5th Perfect). |
P.3.py |
Negative Test | Proper Divisor Summation | Verified 86,619,373 is not perfect. |
P.4.py |
Lucas-Lehmer (LLT) | Finds Mersenne Primes efficiently. | |
P.5.py |
Master Generator | LLT + Euclid-Euler | Full Pipeline. Generates perfect numbers. |
P.6.py |
Optimized Search |
|
1,000x faster than P.2. Direct check. |
P.7.py |
Interactive Verifier |
tqdm + Loop |
Final UI Version. Best for repeated testing. |
PP.1.py |
Continuous Search | LLT + Internal Math Logging | Verbose Mode. Shows internal math growth. |
PP.2.py |
Probabilistic Scan | Miller-Rabin + Bitwise Ops | Fastest. Best for huge candidate ranges. |
PP.3.py |
AKS Polynomial | Mathematical Masterpiece. Deterministic. | |
PP.4.py |
Mersenne Brute | Trial Division ( |
Validates first 80 exponents for accuracy. |
PP.5.py |
Range Benchmark | Iterative Modular Reductions | Measures performance across specific ranges. |
PP.6.py |
Large-Scale Search | Batch LLT (No Logs) | Most Aggressive. Optimized for 800k+. |
PP.7.py |
Modular Sieve | Hardcoded Prime List | "Security Guard." Filters composites early. |
PPP.2.py |
Official Benchmark | Silent Miller-Rabin | Scientific Testing. Multi-stage timing. |
PR1.py |
Two-Stage Search | Last-Digit Filter ( |
UI Optimized. Skips evens/5s automatically. |
PR2.py |
Visualization | Ulam Spiral Algorithm | Pattern Seeking. Maps primes to a 2D grid. |
For large-scale discovery, this project uses a three-tier filtering system:
- Sieve (
PP.7): Immediately discards 60% of candidates using a hardcoded list of 1,200 primes. - Probabilistic (
PP.2): Rapidly screens remaining candidates using Miller-Rabin. - Deterministic (
PP.6): Performs the final Lucas-Lehmer verification without logging overhead.
Includes a full implementation of the AKS Primality Test, proving that primality can be determined in polynomial time (
The Ulam Spiral generator allows for the study of prime clustering. By mapping primes onto a coordinate system, we can visually inspect for patterns that may correlate with the spacing of Mersenne exponents.
Most scripts require standard Python 3.x. Advanced UI features require tqdm.
# Clone the repository
git clone https://github.com
# Install dependencies
pip install tqdm sympy matplotlib.Krishna — Experimenting with Perfect Numbers and researching the most efficient methods for primality testing.