Factoring Lab

Receipts for factoring ideas: which work, which don’t, and how fast they stop working.

A2 · The graveyardJust divisibility

Last digits and digit patterns

Primes past 5 end in 1, 3, 7 or 9, so N, p and q have last-digit rules. It is pure arithmetic, and it never narrows p down.

The idea

Primes past 5 end in 1, 3, 7 or 9, and the last digit of N is the last digit of (last digit of p) × (last digit of q). But for any last digit of N, each of the four endings of p has a matching ending of q. So the ending of N leaves all four endings of p possible, equally often. The same goes for any : digit sums (mod 9), mod 6, mod 30.

Watch it

Rows: N’s remainder. Columns: the smaller prime p’s remainder. Each cell counts toy keys; an even row means N’s remainder says nothing about p’s.

The test

measures, in bits, how much N’s tells you about p’s. Proper keys: about 0 bits. Positive control: a broken generator whose larger prime is always ≡ 1 gives the full log₂ bits away, and the same test sees it.

Fig. A2.2Information about p’s remainder from N’s remainder, for several moduli: proper keys and the broken-generator control

Measuring…