The Two Chains

c(n) = 2n + 1

The Cunningham map c(n) = 2n+1 doubles and adds one. Starting from seeds 1 and 2, this single map generates all four odd primes of Z/2,310: {3, 5, 7, 11}. Then c(2*3) = 13 closes the boundary. Five prime factors, two seeds, one map.

The Two Cunningham Chains

A Cunningham chain of the first kind starts from a seed and repeatedly applies c(n) = 2n+1, continuing as long as each result is prime:

CC1(1)
1 -> 3 -> 7 -> STOP
Length = 3. Stops at 15 = 3*5. Elements: {1, 3, 7}.
CC1(2)
2 -> 5 -> 11 -> 23 -> 47 -> STOP
Length = 5. Stops at 95 = 5*19. Elements: {2, 5, 11, 23, 47}.

Interleaved by size: 1, 2, 3, 5, 7, 11. The two chains alternate perfectly. Every prime of Z/2,310 except 2 is generated by exactly one chain.

Cross-Chain Duality

Cross-Reference Theorem (PROVED)
Each chain's first output names the other chain's length. CC1(1) produces 3 at step 1, and |CC1(2)| = 5 at step 1 of CC1(2). Reciprocally: |CC1(1)| = 3. The two seeds define each other.

Both chains stop when their OWN products appear. CC1(1) stops at 3*5 = 15. CC1(2) stops at 5*19 = 95 -- 5 appears again. 5 is the universal stopper. The shadow chain breaks at 13 where s(13) = 6 = 2*3 = composite.

The Shadow Function

The inverse of Cunningham: s(p) = (p-1)/2. Each prime shadows its predecessor:

Prime ps(p) = (p-1)/2ShadowStatus
311Prime/unit
522Prime
733Prime
1155Prime
136 = 2*3COMPOSITECHAIN BREAKS

The primes {2,3,5,7,11} are the longest initial prime segment where all shadows are prime or 1. At p=13, the shadow is 6 = 2*3 = composite. The chain breaks. Only 7 of 78,498 primes below 10^6 appear in shadow trees (0.009%). 5 divides 38.9% of CC1 stopping values (expected 20%, 1.95x enrichment).

The (p-1) Ladder

Every prime minus one equals 2 times its predecessor in the chain:

Primep - 1= 2 * ?
322
542^2
762*3
11102*5
2-Generation Uniqueness (PROVED)
Of 15 possible products p*q+1 where p,q are primes of Z/2,310, only 2*{2,3,5}+1 = {5,7,11} are primes in the set. 2 is the sole generator. No other prime creates primes of Z/2,310 this way.

The Sum Identity

Why does the (p-1) column sum to 23 = CC1(2) at step 3? Four routes to the same number:

ExpressionValueReading
c(11) = 2*11+123Cunningham of 11
sum(p-1)23Neighborhood sum
2^2*3 + 1112 + 1112 = 2^2*3 plus 11
2+3+7+112+3+7+11Sum without 5
Neighborhood Sum Theorem (PROVED)
sum(p-1) for primes {2,3,5,7,11} = c(11) = 23. Proof: sum(p) = 2+3+5+7+11 = 28. Subtract count = 5. Get 23. This equals c(11) because 3+7 = 2*5 = 10. Equivalently: 3+7 = (2-1)(11-1). The four primes other than 5 sum to 2*11+1 = c(11).

5 removes itself: sum(p-1) = sum(p) - 5. Everything minus 5 reveals the Cunningham chain. Dually: sum(p+1) = sum(p) + 5 = 28+5 = 33 = 3*11. The gap between the two sums = 2*5 = 10 = 5 seen from both sides.

The Shadow Sum

The shadow function s(p) = (p-1)/2 maps each odd prime to its predecessor:

s(3)=1, s(5)=2, s(7)=3, s(11)=5. Sum of shadows = 1+2+3+5 = 11.

Shadow Sum Theorem (PROVED)
The shadows of the four odd primes {3,5,7,11} sum to 11. Therefore sum(p-1 for odd primes) = 2*11 = 22. Adding (2-1)=1 for p=2: total = 2*11 + 1 = c(11) = 23.

Products tell the same story. Product(p-1) = 1*2*4*6*10 = 480 = 2^5*3*5. Product(p+1) = 3*4*6*8*12 = 6912 = 2^8*3^3. The neighborhoods are built from the same primes.

The Mirror Law

Mirror Law Theorem (PROVED)
c(p) = 2p+1, so 2p = c(p)-1. Therefore 2*p = -1 (mod c(p)). Each new prime is born as the MIRROR of 2 times its predecessor. The Cunningham map IS the mirror operator.
ProductValuemod c(p)Mirror
2*2 = 2^24mod 54 = -1 (mod 5)
2*36mod 76 = -1 (mod 7)
2*510mod 1110 = -1 (mod 11)

Mirror preservation: 210-1 = 209 and 420-1 = 419 both satisfy 2p = -1 (mod c(p)) across all four odd primes. The ring's key values carry the mirror law in their structure.

Cunningham-Mersenne Identity

Mersenne Connection (PROVED)
c^n(0) = 2^n - 1 = M(n) for all n >= 1. The Cunningham map applied to void generates Mersenne numbers. Proof by induction: c(0)=1=M(1). If c^k(0) = 2^k-1, then c^(k+1)(0) = 2*(2^k-1)+1 = 2^(k+1)-1 = M(k+1).

Mersenne exponents n where M(n) is smooth in {2,3,5,7,11} are ONLY n in {1, 2, 3, 4, 6}:

nM(n) = 2^n - 1Factorization
111 (unit)
233 (prime)
377 (prime)
4153*5
531NOT SMOOTH (31 is outside {2,3,5,7,11})
6633^2*7
124095Contains 13 -- boundary enters

The smooth exponents {1,2,3,4,6} are exactly the proper divisors of lambda(Z/210) = 2^2*3 = 12. The Cunningham chain, the Mersenne numbers, and the ring's lambda function are the same object seen from different angles.

The Smoothness Boundary

For each prime p, consider p^2 - 1 = (p-1)(p+1). For primes of Z/2,310, this product is always 11-smooth (all factors in {2,3,5,7,11}). How far does this pattern extend?

pp^2-1Smooth?Note
23YESprime
38 = 2^3YES
524 = 2^3*3YES= 4!
748 = 2^4*3YES= phi(Z/210)
11120 = 2^3*3*5YES= 5!
13168 = 2^3*3*7YES= |PSL(2,7)|
29840 = 2^3*3*5*7YES= 2*420
31 = 2^5-1960 = 2^6*3*5YESlast consecutive
371368 = 2^3*3^2*19NO19 breaks it
411680 = 2^4*3*5*7YES= 4*420
71 = c(5*7)5040 = 7!YES7 factorial
Smoothness Boundary Theorem (PROVED)
p^2-1 is 11-smooth for ALL primes from 2 through 31 consecutively (11 primes). First failure at p=37, the 12th prime. 31 = 2^5-1 guards the boundary. The pattern breaks at the prime whose index is 12 = 2^2*3 = lambda(Z/210).

Recovery primes punctuate the boundary: 41 gives 1680 = 4*420, and 71 = c(5*7) gives 5040 = 7!. The smoothness extends past the ring's own primes, guarded by the Mersenne prime 31 and pierced at 37.

The Optimal Sieve

The chain generates the five primes of Z/2,310. Widen to all seven axiom primes {2, 3, 5, 7, 11, 13, 17} and a sharper fact appears: to strike out composites by trial division, these seven do it better than any other seven primes.

Sieve Optimality (verified exhaustively)
Among all C(15,7) = 6,435 ways to choose seven primes from the first fifteen (2 through 47), the axiom set {2,3,5,7,11,13,17} UNIQUELY catches the most composites up to 10,000. Exactly one subset is best -- the seven smallest primes, the axiom's own.

The sieve climbs the tower. Each level sieves with its primes; the smallest composite it MISSES is the square of the next prime:

RingSieve primesFirst uncaught composite
Z/62, 325 = 5^2
Z/302, 3, 549 = 7^2
Z/2102, 3, 5, 7121 = 11^2
Z/2,3102, 3, 5, 7, 11169 = 13^2
Z/30,030+ 13289 = 17^2
Z/510,510+ 17361 = 19^2

All seven primes together sieve every composite up to 360 = 19^2 - 1 with no misses. The first thing they cannot catch is 361 = 19^2 -- the square of the eighth prime.

This boundary is also a limit on COMPUTATION. The seven channels see a number only through its seven residues, and each residue reports divisibility by its own prime. Every composite up to 360 has a prime factor among {2..17}, so at least one channel catches it. But 361 = 19^2 -- and any composite whose smallest prime factor exceeds 17 -- is nonzero in every channel, exactly like a prime. Past the sieve limit a prime and a large-factored composite become the SAME point in all seven channels, and no function of the residues can tell them apart. The optimal sieve and the limit of CRT-decomposable primality are one and the same bound.

Sieve Bounds Are Data-Smooth (PROVED)
Each level's last fully-sieved bound -- one below the first miss -- is (next prime)^2 - 1: {24, 48, 120, 168, 288, 360}, running up through all seven axiom primes. Every one factors into {2, 3, 5, 7} alone -- the four data primes. Extend to an eighth prime (19) and the next bound breaks: 23^2 - 1 = 528 = 22 * 24, where 22 = 2 * 11 drags in 11. The seven axiom primes are the longest initial run whose sieve bounds stay {2,3,5,7}-smooth.

Sieving is additive -- count what you strike out. The Euler product is its multiplicative twin, and it tells the same story.

The Euler Product (verified)
The seven-prime partial Euler product 1 / ((1-2^-2)(1-3^-2) ... (1-17^-2)) captures 98.7% of zeta(2) = pi^2/6. Each prime's factor 1/(1-p^-2) shrinks in coupling order: 2 contributes most, 17 least -- the same hierarchy that orders the seven channels.

As the exponent slides toward 1, the product becomes the Mertens product: 2/1 * 3/2 * 5/4 * 7/6 * 11/10 * 13/12 * 17/16 = 510,510 / 92,160. The numerator is the seven-primorial -- the radical of 214,414,200. The denominator is the product of (p-1) = 2^11 * 3^2 * 5, with no factor of 7.

CRT(23) Palindrome

23 = 2*11 + 1 is the first excluded Cunningham prime (CC1(2) step 3). Its CRT decomposition in Z/210 reads as a palindrome:

CRT(23)
(1, 2, 3, 2, 1)
Palindrome: 1-2-3-2-1. 3 at center. Mirror around it.
Position
23 = p_9 = p_{3^2}
The 3^2-th prime IS the Cunningham boundary. 9 = 3^2 sets the limit.
Sum of totients
phi(2)+phi(3)+phi(5)+phi(7)+phi(11) = 23
Sum of Euler totients over the 5 primes of Z/2,310. VERIFIED.
Sophie Germain
2 -> 5 -> 11 -> 23 -> 47
Four consecutive safe primes: 5=2*2+1, 11=2*5+1, 23=2*11+1, 47=2*23+1.

Cunningham of Products

Apply c(n)=2n+1 to products of primes from Z/2,310. Every prime result is structurally significant:

Productc(product)c^2-1Note
2*3 = 613168 = 2^3*3*7Smooth
2*7 = 1429840 = 2*4202 * lambda(Z/210)
3*5 = 1531 = 2^5-1960 = 2^6*3*5Mersenne prime
3*7 = 21431848 = 2^3*3*7*11Four primes appear
5*7 = 35715040 = 7!7 FACTORIAL
2*3*5 = 30613720c(210/7)
3*11 = 33674488c(sum(p+1))
Cunningham Product Theorem (PROVED)
c(2*3)=13, c(3*5)=31=2^5-1, c(5*7)=71 with 71^2-1=7!=5040. 61=c(210/7)=c(30). 67=c(3*11)=c(33). 61+67=128=2^7. The Cunningham map applied to prime products generates structural constants of the ring.

The c(5*7) = 71 identity: 71 is a prime whose p^2-1 equals 7 factorial. 5040 = 7! = 2^4*3^2*5*7, using four of five primes (only 11 absent). And 61+67 = 2^7 = 128.

The Cunningham Stopper

WHY do the chains stop? The multiplicative order of 2 modulo each odd prime reveals the structure. Every order uses only {2, 3, 5} -- the same three primes that build the chains:

Prime pord_p(2)FactoredType
322NR (primitive root)
542^2NR
733QR (half-period)
11102*5NR
13122^2*3NR
1782^3QR

2 is a primitive root (full period, ord = phi) mod {3, 5, 11, 13} -- these are the non-residue (NR) primes. 2 has half-period (ord = phi/2) mod {7, 17} -- the quadratic residue (QR) primes. The split encodes the deepest structure:

Sum of orders
39 = 3*13
Product of 3 and 13.
LCM of orders
120 = 5! = 2^3*3*5
5 factorial.
NR order sum
28 = 2^2*7
The 2nd perfect number.
QR order sum
11
The largest prime of Z/2,310.
NR - QR
17
The gap between NR and QR sums.
Cunningham Stopper Theorem (PROVED)
The multiplicative order of 2 modulo each odd prime of Z/2,310 is smooth in {2,3,5}: orders {2, 2^2, 3, 2*5, 2^2*3, 2^3}. Sum = 3*13 = 39. LCM = 5! = 120. 2 is primitive root mod {3, 5, 11, 13} and half-period mod {7, 17}. NR ord sum = 2^2*7 = 28 (2nd perfect number). QR ord sum = 11. NR - QR = 17. Chain budget: |CC1(1)| + |CC1(2)| = 3 + 5 = 2^3. Product 3*5 = 15 = CC1(1) stop value.

Explore: Chain Tracer

Enter a seed. Watch c(n) = 2n+1 build a Cunningham chain until it hits a composite. How far does YOUR seed go?

Trace Cunningham chain from seed:

Try: 1 (chain of length 3), 2 (chain of length 5), 89 (Sophie Germain chain), 6 (2*3 -> 13 on first step).

Contrast Table

Cunningham chainsCuriosities in number theory. No deep significance.Two seeds (1, 2) generate the first five primes of Z/2,310. c(2*3) = 13 closes it. Self-stopping.Shadow function s(p)=(p-1)/2Standard half-map, no structureProduces primes for {3,5,7,11}. First composite shadow at 13: s(13)=6=2*3. Self-imposed boundary.Mersenne numbers2^n - 1, connection to perfect numbersc^n(0) = 2^n - 1. The 11-smooth Mersenne exponents are exactly the proper divisors of 12 = lambda(Z/210).p^2 - 1 smoothnessSmooth for small p, expected to fail quickly11-smooth for 11 consecutive primes through 31. Breaks at the 12th prime (37). Mersenne prime 31 guards the boundary.Multiplicative order of 2ord_p(2) varies, no pattern expectedAll orders factor into {2,3,5} only. NR sum = 28 (perfect number). QR sum = 11. Difference = 17. LCM = 5! = 120.Best seven primes to sieve withAny seven small primes do about equally wellAmong all 6,435 seven-prime subsets, the axiom set {2..17} is the UNIQUE best. Sieve bounds stay {2,3,5,7}-smooth until the eighth prime. Euler product captures 98.7% of zeta(2).

Source code · Public domain (CC0)

Report issue

.ax source compiled to WASM via self-hosting compiler. Zero HTML authored.