Skip to main content

Twin Prime Finder

API reference

Find twin prime pairs (primes that differ by 2, like 11 & 13) starting from any number up to 1 billion. Get the first N pairs, the gaps between them, and Brun's-constant partial sum.

Input

Output

Twin prime pairs
Details
 
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/twin-prime-finder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "start": "1",
    "count": "10"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `twin-prime-finder` tool (Twin Prime Finder) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/twin-prime-finder/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Twin Prime Finder — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

The Twin Prime Finder lists twin primes — pairs of primes that differ by exactly 2, such as (3, 5), (11, 13) and (17, 19). Pick a starting number and how many pairs you want, and the list appears instantly.

How to use it

  1. Enter Start from — the search begins at this number (up to 1,000,000,000).
  2. Enter Number of pairs (1–500).
  3. Read the pairs, the summary, and the details panel with the gaps between consecutive pairs and the partial sum of their reciprocals.

Commas and spaces in numbers are ignored.

What are twin primes?

A twin prime pair is two primes (p, p + 2). (3, 5) is the only pair that includes 3; every other pair has the form (6k − 1, 6k + 1). Whether there are infinitely many twin primes is the famous, still-open Twin Prime Conjecture.

What is Brun's constant?

Brun proved that the sum of reciprocals of all twin primes converges, to about 1.902. The details panel shows the partial sum for the pairs you listed, so you can watch it creep upward.

Why is the start limited to one billion?

Primality is checked by trial division in your browser; capping the start keeps every search instant. To test a single large number, use the Prime Checker, or list primes in a range with the Prime Factorization Calculator.

Privacy

Everything runs locally in your browser. Nothing you enter is uploaded.

twin primesprime pairsprime numbernumber theorybrun's constantmath

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.