# prime-formula
A Rust implementation of the Formula of Primes (FOP) using insights from the Periodic Table of Primes (PTP).
## Overview
For millennia, prime numbers have eluded precise prediction, their distribution remaining one of mathematics'
greatest mysteries. This project implements groundbreaking research that establishes a Periodic Table of Primes
(PTP) – a revolutionary framework for understanding prime numbers and their patterns.
### Key Theory Foundations
1. Periodic Table of Primes (PTP)
- Built from the foundational primes 2, 3, 5, and 7
- Identifies 48 critical integers within every 210-number cycle (2×3×5×7)
- These 48 integers generate all primes and composites without factors of 2, 3, 5, or 7
2. Formula of Primes (FOP)
- Algorithmically generates primes, twin, triple or higher primes
- Reveals deterministic relationships between primes and their PTP roots
3. Counting Functions
- Provides analytical tools for prime and twin prime distribution analysis
### Features
Rust CLI & Library Implementation
- 🚀 Generate primes using PTP's 48-root framework
- 🔍 Analyze twin and triple prime distributions
- 📈 Compute prime counting functions
- ⚡ High-performance Rust implementation for:
- Large-number theory applications
- Cryptographic research
- Mathematical pattern discovery
### Installation
```commandline
# For library use
cargo init
cargo add prime-formula
```
Will initialize a new rust project and pull in the prime-formula library.
```
# For CLI use
cargo install prime-formula
```
Will install the binary locally to get started quickly.
### Usage
```commandline
# Generate primes using prime-formula CLI
prime-formula 0 1e6
```
Will count primes in the range 0 - 1,000,000.
```commandline
prime-formula --dist 1e3 -c 2
```
Will count twin primes in the range 0 - 1,000.
```commandline
prime-formula 1e12 --dist 1e3 -p
```
Will find primes that are at least 1×10<sup>12</sup> in size with a window size of 1,000.
### Why This Matters
This implementation bridges theoretical number theory with practical computation, offering:
- A predictive framework for prime distribution
- New tools for twin prime conjecture analysis
- Efficient algorithms leveraging PTP's structural insights
### References
> "Each prime is an offspring of the 48 integers on the PTP – finally giving us a periodic law for primes."
Paper: [Periodic Table of Primes (PTP) Theory](https://ssrn.com/abstract=4742238)