Cousin Primes Generator
Generate cousin prime pairs (p, p+4) within any range. Uses Sieve of Eratosthenes for fast computation up to 100 million with export options.
| # | p | p + 4 | Sum | Product |
|---|
About
Cousin primes are pairs of primes (p, p + 4) where both values are prime. They belong to the broader class of prime gaps studied in analytic number theory alongside twin primes (gap 2) and sexy primes (gap 6). The first Hardy - Littlewood conjecture predicts their density decreases as Cln2(n) where C ≈ 1.1970449 is a specific product over primes. Miscounting cousin primes or confusing them with twin or sexy primes leads to flawed assumptions in cryptographic gap analysis and prime distribution research.
This tool implements a segmented Sieve of Eratosthenes on a Web Worker thread. It computes all primes in your specified range, then filters pairs where p and p + 4 both appear in the sieve. Ranges up to 108 are supported. The tool approximates prime pair counts. It does not prove the infinitude of cousin primes. That remains an open conjecture.
Formulas
Two primes p and q form a cousin prime pair if and only if:
where both p and q are prime. The conjectured density of cousin primes below N follows the first Hardy - Littlewood conjecture:
where C2 ≈ 0.6601618 is the twin prime constant, and the product runs over odd primes p dividing the gap. The factor 4 corrects for the gap size relative to twin primes. The Sieve of Eratosthenes marks composites up to √N. For each surviving prime p, if p + 4 also survives, the pair is recorded.
where p = a prime number in the sieve, q = the cousin candidate (p + 4), N = the upper bound of the search range, π4(N) = the cousin prime counting function, C2 = the twin prime constant.
Reference Data
| Pair # | Cousin Prime Pair (p, p + 4) | Sum | Product |
|---|---|---|---|
| 1 | (3, 7) | 10 | 21 |
| 2 | (7, 11) | 18 | 77 |
| 3 | (13, 17) | 30 | 221 |
| 4 | (37, 41) | 78 | 1517 |
| 5 | (43, 47) | 90 | 2021 |
| 6 | (67, 71) | 138 | 4757 |
| 7 | (79, 83) | 162 | 6557 |
| 8 | (97, 101) | 198 | 9797 |
| 9 | (103, 107) | 210 | 11021 |
| 10 | (109, 113) | 222 | 12317 |
| 11 | (127, 131) | 258 | 16637 |
| 12 | (163, 167) | 330 | 27221 |
| 13 | (193, 197) | 390 | 38021 |
| 14 | (223, 227) | 450 | 50621 |
| 15 | (229, 233) | 462 | 53357 |
| 16 | (277, 281) | 558 | 77837 |
| 17 | (307, 311) | 618 | 95477 |
| 18 | (313, 317) | 630 | 99221 |
| 19 | (349, 353) | 702 | 123197 |
| 20 | (397, 401) | 798 | 159197 |
| 21 | (439, 443) | 882 | 194477 |
| 22 | (457, 461) | 918 | 210677 |
| 23 | (463, 467) | 930 | 216221 |
| 24 | (487, 491) | 978 | 239117 |
| 25 | (499, 503) | 1002 | 250997 |