Factoring Lab

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

factoringlab.dev

Receipts for factoring ideas

Every few months someone finds a “pattern in the primes” that might break . This lab tests those ideas with a fixed test and a control, shows the methods that really factor numbers, and measures how fast each one stops working.

Start with the primes pattern (A1) Watch Pollard’s rho

28chapters planned
28live now
0patterns that beat the sieve
½rho’s measured scaling exponent

Toy numbers only. Every number factored here is generated in your browser and is at most 64 bits. There is no way to load a real key, and the weak-key chapters exist to show why proper key generation rules each weakness out.

How ideas die

Like overfit.bot’s strategy graveyard, every chapter ends in one of these verdicts.

  • Just divisibility Fully explained by small primes dividing things.
  • do it too Random numbers with the same divisibility show the same effect.
  • No leak A test with a working positive control finds no usable information.
  • Real, already known A genuine effect predicted by known theory. It doesn’t find factors.
  • Works only on weak keys Breaks keys built badly; proper keys are made to avoid it.
  • Works, and here’s how it scales A real method. The receipt gives its measured growth rate.
  • Real, not yet reachable A true algorithm that needs hardware nobody has built. The receipt is arithmetic on published estimates.
A

The graveyard

Ideas that don’t work

Popular ideas for predicting primes or factoring numbers. Each one looks promising, and each gets a fixed test, a control and a receipt showing where it breaks.

A1 Live

Prime spirals and “new patterns”

Triangles, spirals, hexes and wheels all draw the same small-prime divisibility. Fake primes make the same pictures, and the pattern can’t find the secret prime in N = p × q.

Just divisibility
A2 Live

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 remainder arithmetic, and it never narrows p down.

Just divisibility
A3 Live

Machine learning predicts p mod k

Train a model to guess p mod 3, 5 and 7 from N. It sits at chance for all three, while a planted leak is caught every time.

No leak
A4 Live

Searching near √N

Fermat’s method is instant when p and q are close together, and hopeless when they are random. Real keys keep them far apart.

Works only on weak keys
A5 Live

Predicting the next prime gap

Gaps look rhythmic, but their statistics match the Cramér and Hardy–Littlewood models. Totals are predictable; the next gap is not.

Real, already known
A6 Live

A neural network on N itself

A small neural net looks at the bits of N for a clue about p. With a hidden nonlinear clue planted it finds it at once; on honest keys it sits at chance.

No leak
A7 Live

Benford and the digits of p

Primes’ leading digits follow their own pattern, not Benford’s law. N’s first digit tells you p’s only through the known size of p.

No leak
A8 Live

Twin primes: clustering without location

Twin primes are over-represented exactly as Hardy–Littlewood predicts. Trying them first beats counting up, but so does any arbitrary subset of the same size, so twins are not the reason.

No leak
A9 Live

Magic sequences: Collatz, Fibonacci, digit sums

Famous number games measured against p mod 4. None beats shuffling, and a planted clue is always caught.

No leak
A10 Live

Quantum reality check

What has been factored on quantum hardware (15, 21, with caveats), what RSA-2048 would need on paper, and a short, sober look at post-quantum cryptography.

Real, not yet reachable
B

Methods that work

And how they scale

The algorithms that really factor numbers, visualized, with charts of how the work grows as the numbers get bigger. That growth rate is the whole story of .

B1 Live

Trial division

Divide by every candidate up to √N. The work grows in step with the size of the smallest prime factor: double p, double the work.

Works, and here’s how it scales
B2 Live

Pollard’s rho

Repeat x → x² + c. Taken mod the hidden prime p, the sequence loops after about √p steps (the birthday paradox), and a gcd reveals p.

Works, and here’s how it scales
B3 Live

Smooth numbers: the idea the next three methods run on

How often numbers have only small factors, against Dickman’s ρ. The one “pattern” that p − 1, the quadratic sieve and ECM all rely on.

Real, already known
B4 Live

Pollard’s p − 1

Fast exactly when p − 1 is made only of small primes. Success rate against the smoothness bound B.

Works, and here’s how it scales
B5 Live

Williams’ p + 1

The sibling of p − 1: it works when p + 1 is smooth. Together the two cover keys that either one misses.

Works, and here’s how it scales
B6 Live

CFRAC: continued fractions before the sieve

The continued fraction of √N hands out squares that are almost N. The method that factored F₇ in 1970 and led straight to the quadratic sieve.

Works, and here’s how it scales
B7 Live

A toy quadratic sieve

Collect smooth values of x² − N, combine them into x² ≡ y² (mod N), and take a gcd. The first sub-exponential method.

Works, and here’s how it scales
B8 Live

Elliptic curves (ECM)

Like p − 1, but every curve is a fresh chance for a smooth group order. Finds medium-size factors of huge numbers.

Works, and here’s how it scales
B9 Live

The number field sieve, explained

The method behind modern factoring records: sieve for pairs where both a − b·m and a norm are smooth. Live for the smallest case, N = m² + 1; the matrix and square-root steps are explained, not run.

Works, and here’s how it scales
B10 Live

Shor’s algorithm, simulated classically

Period finding step by step for N = 15 and 21: the table of powers, the collapse, the Fourier peaks, the continued fraction, the gcd. A simulation, and why it stops at toy size.

Works, and here’s how it scales
B11 Live

The big picture: how far each method reaches

Every method on one chart, and where RSA-2048 sits: far off the edge.

Works, and here’s how it scales
C

Weak keys

When RSA really breaks

breaks when keys are made badly: shared primes, primes too close together, or primes with a special shape. Demonstrated on toy keys generated in your browser.