Twin Prime Conjecture
Count twin prime pairs — primes that differ by 2 — up to a chosen limit and plot how the count grows. The conjecture says this never stops, but nobody has proved it.
Twin primes differ by 2, like (11, 13). The count keeps rising as N grows, but more slowly. In 2013 Zhang proved some bounded prime gap repeats forever; the gap has since dropped to 246 — but the specific gap of 2 is still unproven.
What you are seeing
A sieve marks all primes up to the limit.
We scan the primes and count consecutive pairs that differ by exactly 2, such as (3,5), (11,13), (17,19).
The chart shows the running count, which keeps climbing but more slowly.
Why it matters
In 2013 Yitang Zhang proved that some prime gap of finite size repeats forever, a breakthrough toward the twin prime conjecture. The gap has since been pushed down to 246, but the specific gap 2 remains open.
Complexity & details
Sieve is O(n log log n); a single scan collects all twin pairs.
Frequently asked questions
Are there infinitely many twin primes?+
This is exactly the conjecture. It is widely believed true and supported by heuristic estimates, but unproven.
What did Zhang prove?+
That infinitely many prime pairs are separated by some bounded gap, originally 70 million and now 246.