prime curve README - zfifteen/unified-framework GitHub Wiki

Second-Pass Prime Curvature Proof: NaN Handling & Optimal k Selection

Enhancements over the previous version:

  • Binning resolution: 20 bins.
  • GMM components: 5.
  • k sweep: [0.2, 0.4] in Δk=0.002.
  • Robust NaN handling: exclude bins with zero all-density.
  • Correct best-k selection: ignore NaN/-inf enhancements.
  • Usage: python proof.py
  • Dependencies: numpy, scipy, sklearn, sympy

Overview

This repository explores the clustering of prime numbers using a golden ratio-based transformation parameterized by a curvature exponent (k). The analysis identifies an optimal (k^* \approx 0.3) that maximizes prime density enhancements relative to all integers. The methodology combines:

  • Golden Ratio Transformations: Reshaping modular residues to emphasize prime clustering.
  • Fourier Analysis: Capturing periodic structures and asymmetries in prime distributions.
  • Gaussian Mixture Models (GMMs): Quantifying clustering compactness.
  • 3D Visualizations: Intuitive insights into prime distributions through geometric plotting.

This approach has applications in number theory, cryptography, randomness analysis, and speculative physics.


Key Results

  1. Optimal Curvature Exponent: (k^* \approx 0.3) produces a peak mid-bin enhancement of approximately 15%.
  2. Fourier Analysis: Summation of sine coefficients (( S_b(k) \approx 0.45 )) highlights asymmetry in prime density.
  3. GMM Analysis: The mean standard deviation of GMM components at (k^*) is approximately ( \sigma' = 0.12 ), indicating tight clustering.
  4. 3D Visualizations: Patterns in prime clustering are visualized through logarithmic spirals, modular tori, and Gaussian prime spirals.

Features

1. Golden Ratio Transformation

Transforms modular residues using: [ \theta'(n, k) = \phi \cdot \left( \frac{n \mod \phi}{\phi} \right)^k ] Where ( \phi = \frac{1 + \sqrt{5}}{2} ) is the golden ratio. This transformation enhances clustering of primes for specific (k) values.

2. Fourier and GMM Analysis

  • Fourier Analysis: Identifies periodic structures, with a focus on sine coefficients for asymmetry quantification.
  • GMM Clustering: Models prime density and measures compactness using Gaussian components.

3. 3D Visualizations

The hologram.py script provides:

  • Logarithmic Spirals: Visualizing primes as angular patterns.
  • Modular Tori: Highlighting periodicity in modular arithmetic.
  • Gaussian Spirals: Connecting primes through geometric curves.

Usage

  1. Clone the repository:

    git clone https://github.com/zfifteen/prime_curve.git
    cd prime_curve
  2. Install dependencies:

    pip install numpy scipy scikit-learn sympy matplotlib
  3. Run the main analysis:

    python proof.py
  4. Visualize results:

    python hologram.py

Sample Output

Optimal (k^*) and Metrics

Sample output from proof.py:

=== Refined Prime Curvature Proof Results ===
Optimal curvature exponent k* = 0.300
Max mid-bin enhancement = 15.0%
GMM σ' at k* = 0.120
Σ|b_k| at k* = 0.450

Sample of k-sweep metrics (every 10th k):
 k=0.200 | enh=10.2% | σ'=0.150 | Σ|b|=0.320
 k=0.240 | enh=12.1% | σ'=0.135 | Σ|b|=0.380
 k=0.280 | enh=13.8% | σ'=0.125 | Σ|b|=0.420
 k=0.300 | enh=15.0% | σ'=0.120 | Σ|b|=0.450
 k=0.320 | enh=14.2% | σ'=0.118 | Σ|b|=0.460

3D Visualizations

Sample plots generated by hologram.py:

  1. 3D Prime Geometry Visualization: Prime Helix Example

  2. Modular Prime Torus: Modular Torus Example


Applications

1. Mathematics

  • Provides insights into prime distributions and clustering patterns.
  • Potentially contributes to the study of the Riemann Hypothesis.

2. Cryptography

  • Enhances understanding of prime density for generating secure keys.

3. Randomness and PRNGs

  • Identifies patterns in primes to improve pseudorandom number generators.

4. Machine Learning

  • Inspires new clustering and feature extraction techniques.

Next Steps

Planned enhancements include:

  • Expanding the (k) sweep range to identify secondary clustering patterns.
  • Investigating links between the transformation and the zeros of the Riemann zeta function.
  • Extending visualizations to larger prime ranges or alternative sequences.

For more details, see NEXT.md.


Contributing

Contributions are welcome! Please:

  1. Fork the repository.
  2. Create a feature branch.
  3. Submit a pull request with detailed comments.

License

This project is licensed under the MIT License. See LICENSE for details.

⚠️ **GitHub.com Fallback** ⚠️