Prime Spiral Explorer is an interactive prime number visualization and number-theory exploration project focused on prime numbers and semiprimes. It combines multiple geometric mappings, analytics views, and a publishable static frontend so the result can be explored locally or shared as a public portfolio project through GitHub Pages.
The core motivation behind the project is visual exploration: to understand whether primes and semiprimes exhibit different spatial behavior when embedded into 3D structures such as the Ulam tower, helix projections, and related layouts. Instead of treating primes only as an abstract sequence on the number line, the project asks whether geometric representation can make structural differences easier to see.
A longer research-style note based on the original project motivation is available here:
This view projects the sequence into a spiral-like radial structure. Prime and semiprime distributions begin to form visible bands and gaps instead of looking like random raw values.
This view spreads values across a sphere using golden-angle spacing. It is useful for spotting how prime and semiprime distributions behave when projected onto a compact 3D surface.
The modulo view recolors the helix by residue class. Instead of just showing where primes sit, it highlights repeating arithmetic bands through modular coloring.
This preview shows cluster detection on the helix coordinates. It is a fast way to inspect whether local neighborhoods form structured groupings or mostly behave like noise.
- Prime and semiprime structure across multiple geometric mappings.
- A helix-based view for circular layering and residue-style patterns.
- A Ulam-inspired projection for grid structure and diagonal alignment.
- Additional interactive views for Fibonacci sphere, DBSCAN clustering, modulo coloring, zeta mapping, vector directions, and validation analytics.
- A fully static HTML output in
docs/index.html, so the public version can be deployed without a backend.
- Python 3.12 or newer
- A modern desktop browser
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python main.pyThe script generates the public site into docs/index.html and opens it in the browser.
- Open the generated page.
- Use the top
Viewbuttons to switch between Helix, Ulam 3D tower, Fibonacci sphere, clustering, modulo, zeta, vector, and validation modes. - Use
Filterto show both sets, primes only, or semiprimes only. - In
Modulomode, move the slider to recolor values byn mod k. - In
Pure Ulam validation, switch betweenDownsample,Weighting, andResidualto inspect the analytical comparison panels.
If you update the underlying math or styling and want new README visuals:
.venv\Scripts\Activate.ps1
python tools\generate_readme_images.pyThis regenerates the static preview diagrams in assets/readme/.
- Push the repository to GitHub.
- Open
Settings -> Pages. - Set
SourcetoDeploy from a branch. - Select branch
mainand folder/docs. - Save.
GitHub Pages will publish docs/index.html as the public entry point.
main.pygenerates the interactive HTML site indocs/.docs/index.htmlis the publishable static page.tools/generate_readme_images.pycreates static diagram previews for the README.assets/readme/stores repository preview images.requirements.txtlists the Python dependencies.



