From 2-Adic Geometry to Cunningham Chains: Visualization-Driven GPU Search
Nenad Mićić · LinkedIn · March 2026

What This Is
A visualization hobby project that turned into a high-throughput Cunningham chain search engine. More about HPC optimization and AI-assisted iteration than the math itself.
It started with mapping integers in a 2-adic geometry, noticing structured prime paths, recognizing Cunningham-chain recurrences, and then building a GPU/CPU pipeline to search for long chains.
Results
This project has not yet reached its original target: finding first-kind CC18 or CC19. This was a compute-limited campaign.
As of March 2026, the public Cunningham chain tables at pzktupel.de list results under my name, Nenad Mićić, including:
- new CC16 and CC17 entries
- the current smallest known second-kind CC17
- the current largest known first-kind CC17
The published data snapshot contains 929,574 roots in total, including 44 CC16 roots and 1 CC17. The main campaign was centered on the 89–91 bit range, and the release includes both the search code and derived analysis:
- gap statistics and spacing distributions
- immunization / residue summaries and immune-fingerprint distributions
-
p+1breaker analysis - ghost chains — roots where prime links continue beyond the official chain break, tested to depth 20
- closest CC-twins and CC-clusters (triplets, quadruplets, quintuplets)
I think this dataset is useful in its own right and deserves deeper study.
How It Works
Visual learning led to search design.
The 2-adic coordinate system made chain structure visible. The p+1 factorization view showed which small-factor patterns kill candidates early. That became the sieve.
Depth filtering:
- for each candidate root, cheaply test modular residues across the first
dchain positions before any expensive primality test - GPU does the bulk rejection
- CPU only proves the tiny survivor set
Pipeline:
- GPU (CUDA): 57–65 billion candidates/sec modular filtering (RTX 4090 + RTX 5090)
- CPU (GMP): primality proving on survivors only
The GPU sieve kills 99.9988% of candidates before any primality test is needed. Only 0.0012% survive to BPSW proving.

Interactive Visualizations
Each tool shaped the search design.
- Cunningham Chain Mesh: 2-adic square-perimeter map with CC1/CC2 edges and chain paths
- 2-Adic Tree Explorer: inspectable tree with local chain structure
-
3D Fold: shell structure across levels; top view becomes the
p+1analysis grid -
p+1Analysis: factor coloring for primes, mod-pview for composites - Chain Analyzer: single-chain analysis, breaker autopsy, residue immunity
- Campaign Dashboard: live campaign tracking across bit ranges and chain lengths
- Immunization Dashboard: residue immunity analysis
Project Stack
- Search: CUDA filtering, GMP proving, prefix sharding, checkpointing
- Visualization: standalone HTML/JS tools
- Analysis: Python plus HTML tools for autopsy and fingerprinting
- AI-assisted: LLMs used for coding iteration; math direction and search decisions are human-driven
- Extra: a PARI/GP library and a small MCP server wrapper for interactive Cunningham-chain analysis
Part of the project was also an experiment in AI-assisted iteration: not one-shot prompting, but many rounds of visual exploration, code generation, rejection, correction, and performance tuning. The transferable lesson for me was not number theory itself, but the workflow: isolate the hot path, turn it into something benchmarkable, iterate quickly with AI assistance, and only bring back changes that survive measurement.
Links
- Code: https://github.com/nmicic/cunningham-chain-search
- Data snapshot: https://github.com/nmicic/cunningham-chain-data
- Interactive visualizations: https://nmicic.github.io/cunningham-chain-search/visualizations/
- Cunningham chain tables: https://www.pzktupel.de/CC/cc.php
- CC16 history: https://www.pzktupel.de/CC/HCC16.php
- CC17 history: https://www.pzktupel.de/CC/HCC17.php
- Author: Nenad Mićić, Belgium





Top comments (0)