#prime #sieve #number-theory #rayon

bin+lib prime-formula

High-performance prime number generation and constellation finding using novel wheel factorization

2 releases

Uses new Rust 2024

new 0.1.1 May 7, 2025
0.1.0 May 6, 2025

#570 in Math

MIT license

79KB
1.5K SLoC

Rust 1K SLoC // 0.2% comments Python 429 SLoC // 0.3% comments

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

Usage

# Generate primes using prime-formula CLI
prime-formula 0 1e6

Will count primes in the range 0 - 1,000,000.

prime-formula 1e12 --dist 1e3 -p

Will show primes found in the range 0 - 1,000 starting at 1×1012.

prime-formula --dist 1e3 -c 2

Will count twin primes in the range 0 - 1,000.

Installation

# For library use
cargo init
cargo add prime-formula  

Will initialize a new rust project and pull in the prime-formula libraries.

# For CLI use
cargo install prime-formula

Will install the binary locally.

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

Dependencies

~8MB
~212K SLoC