Explained from scratch

The primes that can never appear

Certain whole numbers have a strange self-referential property. It turns out that entire families of prime numbers are locked out of that club forever — and one line of arithmetic says which.

1 The question

Suppose you have a rule that turns a whole number into another whole number, and you ask which numbers happen to divide the result of applying the rule to themselves — not exactly, but through their prime ingredients. That is a self-referential condition, and there is no obvious reason it should behave in any orderly way.

The question here is narrower and sharper. Can a prime number be excluded from that club entirely? Not rare, not hard to find — impossible, for every number, forever.

The answer is yes, and the primes it happens to form neat families: for one rule it is every prime that leaves remainder 3 when divided by 4; for another, every prime that leaves remainder 2 when divided by 3.

2 The words you need

Prime
A number bigger than 1 divisible only by 1 and itself: 2, 3, 5, 7, 11, 13… Every whole number is a product of primes in exactly one way.
Radical
Take a number, list the different primes in it, multiply them. For 60 = 2×2×3×5 the different primes are 2, 3 and 5, so the radical is 30. Written rad(n).
Divides
«a divides b» means b is a whole number of copies of a. 7 divides 28; 7 does not divide 30.
Remainder
What is left after dividing. 11 divided by 4 leaves remainder 3. Two numbers with the same remainder are said to be congruent.
Multiplicative order
Keep multiplying a number by itself, and each time keep only the remainder after dividing by a prime p. Eventually you come back to 1. How many steps that takes is the order. Example: powers of 3 with remainders mod 7 go 3, 2, 6, 4, 5, 1 — six steps, so the order is 6.

3 The recipe

Pick a rule f. The oldest is «add up all the divisors»; the one used most here is «take the prime power and add one», so 3³ becomes 27+1 = 28.

The club. A number n belongs when rad(n) divides f(n).

Now the observation that turns this into something you can draw. A prime divides a product only if it divides one of the pieces. So instead of one big multiplication, ask for each prime in your number: is there another prime whose piece is divisible by it? Draw a dot per prime, and an arrow from q to p when the piece contributed by q is divisible by p.

Your number is in the club exactly when every dot has at least one arrow pointing at it. Nobody vouches for themselves; one arrow in is enough.

4 Try it yourself

Take the three primes 3, 7 and 11, and the rule «add one». Choose the exponents 3, 5 and 1, so the number is 4991679 = 3³ · 7⁵ · 11. Work out the three pieces:

3³ + 1 = 28 = 2² · 7   →   the piece from 3 is divisible by 7
7⁵ + 1 = 16808 = 2³ · 11 · 191   →   the piece from 7 is divisible by 11
11 + 1 = 12 = 2² · 3   →   the piece from 11 is divisible by 3
Three dots labelled 3, 7 and 11 with arrows forming a cycle
Everybody is covered, in a circle. 3 vouches for 7, 7 vouches for 11, and 11 vouches for 3. So the radical 3·7·11 = 231 divides the product 28 · 16808 · 12 = 5647488, and the number is in the club.

Now try to do it with only two of those primes. You cannot, and not for lack of trying: each of the three pairs fails, always for the same reason.

order of 7 mod 3  = 1  (odd)   →   7 can never vouch for 3
order of 3 mod 11 = 5  (odd)   →   3 can never vouch for 11
order of 11 mod 7 = 3  (odd)   →   11 can never vouch for 7

5 Where the question came from

An earlier piece of this work computed how often pairs of primes can be covered, and got an exact fraction, 31/72. It also proved something rigid: for two primes that both leave remainder 3 when divided by 4, it is never possible. The reason is a theorem Gauss proved in 1801, quadratic reciprocity: for such a pair, exactly one of the two possible arrows can exist, so one dot always goes unvouched.

That left an obvious question hanging, and nobody had answered it: what happens with three?

6 What was found

Three can do what two cannot — exactly a quarter of the time

With three such primes, each pair still contributes exactly one arrow, so you get a triangle with three arrows. There are eight ways to orient it. In six, somebody is left with no arrow pointing at them. In the other two — the ones that go round in a circle — everybody is covered.

Eight small triangles with arrows; two are highlighted as cyclic
Two out of eight. So exactly 1/4 of such triples work, against none of the pairs. The fraction is not approximate; it is forced by the counting.

Some primes can never be pointed at

Whether an arrow into p can exist depends on the order, and the order always divides p − 1. For some rules, an arrow into p needs that order to be divisible by a fixed number m. Put the two together:

If m does not divide p − 1, then no order can be divisible by m, so no arrow can ever point at p — from any prime, inside any number, ever. That prime divides no member of the club at all.

For the rule q2e+1, that locks out every prime leaving remainder 3 when divided by 4. And here it is in one line: an arrow into 3 would need q2e to leave remainder 2 when divided by 3 — but q2e is a square, and squares leave only remainder 0 or 1. Impossible, forever.

Among the first 429 odd primes, 218 are locked out for that rule, and they are exactly the ones leaving remainder 3 when divided by 4 — not most of them, all of them.

More primes is not always easier

You would expect that adding primes makes covering easier: more dots, more possible arrows. For rules with no locked-out primes that is right — and in fact every set of primes works, because you can always arrange them in a circle. But if a rule has locked-out primes, each extra prime is another chance to draw one, and the proportion falls instead.

Curves showing the proportion of realizable k-tuples rising for one function and falling for two others
The answer depends on the rule, not on the problem. Three rules are always at 1; one climbs towards 1; two fall by half at each step.

7 How it was checked

Every claim was tested twice, by methods that share no reasoning. The fast criterion was checked against a slow brute-force search that simply computes f(qe) as an ordinary integer and looks at its factors. Over thousands of cases the two never disagreed — except once, which is how a genuine mistake was found: for one rule the general description fails at the single prime 3, and 30 disagreements pointed straight at it.

The locked-out primes were checked directly on every whole number up to three million. Of the 379 members of that club, exactly 0 have a forbidden factor.

Why a zero is not evidence on its own. A search that finds nothing proves nothing until you show it would have found something. So the same search was run on a third rule, one with no locked-out primes. It found 578. The machinery works; the zeros are real.

And the last check in the code is deliberately not about these results at all: it reproduces a density computed by Helmut Hasse in 1966. If the machinery agrees with a sixty-year-old published theorem, there is a reason to trust it on the parts that are new.

8 What it is good for

Two things, both practical for anyone working on these objects.

First, it makes searches finite where they were open-ended. If you are hunting for members of one of these clubs, you can now discard half the primes before starting, and know you have lost nothing.

Second, it settles a question that looked like it needed measurement. Whether «more primes helps» is not something to be estimated by sampling: it can be read off the rule in advance, from whether any arrow is forbidden. That turns an empirical question into a one-line check.

9 What it does not claim

10 Glossary

Covering digraph
The picture of dots and arrows described in section 3. Membership of the club is exactly «every dot has an incoming arrow».
Realizable
A set of primes is realizable if some choice of exponents makes the resulting number a member. The primes 3, 7, 11 are realizable; the pair 3, 7 is not.
Uncoverable prime
A prime that no arrow can ever point at, so it divides no member at all.
Quadratic reciprocity
Gauss's theorem relating «is p a square modulo q?» to «is q a square modulo p?». It is what forces the rigidity between pairs of primes leaving remainder 3.
Unitary divisor
A divisor d of n that shares no prime with n/d. Adding them up gives the rule qe+1 on prime powers.

11 Where to read more

Level 1 — if you liked this and want more, without formulas

  1. Marcus du Sautoy, The Music of the Primes (2003). Why primes are irregular and why that irregularity has structure. No formulas.
  2. Numberphile's videos on modular arithmetic and quadratic residues. The idea of «keeping only the remainder», which is the one thing you need for section 6.

Level 2 — a textbook, to study it properly

  1. G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed. Chapters on multiplicative functions and on quadratic reciprocity cover everything used here.
  2. Kenneth Ireland and Michael Rosen, A Classical Introduction to Modern Number Theory. For orders, primitive roots and cyclotomic polynomials — the machinery behind the rule q2e+qe+1.

Level 3 — the work this one is measured against

  1. H. Hasse, «Über die Dichte der Primzahlen p…», Mathematische Annalen 166 (1966). The density 17/24 reproduced as an external control in verify.py. Cited as Hasse's, not claimed.
  2. Tomohiro Yamada, «On a problem of De Koninck», arXiv:1906.10001. Uses a directed multigraph with indegree conditions, for a different equation. The graph framing is therefore not new here.
  3. The technical write-up: RESULT.md, and what was searched: PRIOR_ART.md.