Bruno Prime — Prime numbers as a working topic: how | brunoprime.com
√nTrial division limit
617 digitsSize of an RSA-2048 modulus
52Mersenne primes found so far
50,847,534Primes below one billion

Testing, counting, encrypting

Bruno Prime — Prime numbers as a working topic: how | brunoprime.com

This guide answers two linked questions: how to decide whether a whole number is prime, and why primes sit at the heart of modern encryption. You will get a repeatable primality test, a way to estimate prime counts below any limit, and a clear picture of why multiplying two secret primes produces a hard-to-break key.

brunoprime.com
Prime Number Desk — primality, distribution, cryptography
A working guide to testing primes, counting them, and understanding why encryption depends on them.

Key quantities

Index

50,847,534Primes below one billionA concrete count that shows how many primes survive below 10^9.
25Primes below 100The small end of the same sequence, easy to verify by hand.
4 × 10^18Goldbach verification limitEvery even number up to this bound has been checked as a sum of two primes.

Reference figures

Reference figures for primes, tests and RSA
QuantityValueWhat it tells you
Primes below 10025Small end of the sequence, verifiable by hand
Primes below 1 billion50,847,534Concrete count confirming the x / ln x estimate
Trial division bound√nLargest candidate divisor you ever need
6k ± 1 wheel reduction2 of 6 candidatesTwo thirds of the work removed up front
RSA-2048 modulus2048 bits, ~617 digitsProduct of two secret primes
Miller-Rabin deterministic rangebelow 3.3 × 10^24Fixed small bases settle primality exactly
Largest known Mersenne prime (Oct 2024)2^136279841 − 141,024,320 decimal digits
Goldbach verification limit4 × 10^18Every even number below checked as two primes
Reference figures for primes, tests and RSA

How do I test a number for primality?

Trial division up to the square root of n gives a definitive yes or no.

Start with the number n itself. If n is less than 2 it is not prime. If n equals 2 or 3 it is prime. If n is divisible by 2 or 3, stop: it is composite.

Otherwise test only candidates of the form 6k − 1 and 6k + 1, up to and including the square root of n. If none of them divides n, the number is prime.

The square-root bound is what makes the method practical. A composite number always has a factor at or below its square root, so anything larger than that cannot reveal a new divisor.

  • Reject n < 2 outright.
  • Divide by 2 and 3 first, then walk the 6k ± 1 wheel.
  • Stop as soon as one candidate divides n evenly.
  • If the walk reaches √n without a hit, n is prime.

Terms used on this page

Prime number
A whole number greater than 1 whose only positive divisors are 1 and itself.
Trial division
A primality method that tests candidate divisors up to the square root of n, rejecting n as soon as one divides it.
6k ± 1 wheel
A refinement that skips multiples of 2 and 3, leaving only two candidate forms out of every six integers.
Prime number theorem
The result that the count of primes below x is asymptotically x divided by the natural logarithm of x.
Mersenne prime
A prime of the form 2^p − 1, which can exist only when p itself is prime; 52 have been found so far.
RSA-2048 modulus
A 2048-bit public number, about 617 decimal digits, formed as the product of two secret primes.

Common questions before you start

Do I really have to test every number up to the square root?
Only candidates up to √n matter, and the 6k ± 1 wheel removes two thirds of them before you start dividing.
What if my number is hundreds of digits long?
Switch to Miller-Rabin: below 3.3 × 10^24 fixed small bases make it deterministic, and above that each extra base cuts the error rate quickly.
Why does x / ln x work as an estimate?
The prime number theorem states that the count of primes below x approaches x divided by the natural logarithm of x, and exact counts like 50,847,534 below one billion confirm it.
Can anyone factor a 2048-bit RSA key?
No method tested to date recovers the two secret primes behind a 617-digit modulus in practical time, which is why RSA-2048 remains in use.

How this record was assembled

Every figure on this page comes from a stated, checkable result: exact prime counts, the prime number theorem, the square-root bound, and published RSA key sizes. Nothing here is estimated for effect.

Sources

Figures drawn from standard results in number theory and public cryptography references.

How do I test anumber for primalitHow many primes liebelow a limit?What does aprimality testHow doesMiller-RabinWhy does encryptionrest on primes?
A map of this guide's sections