Mathwords logoMathwords

Large Prime — Definition, Formula & Examples

A large prime is a prime number with many digits, often hundreds or thousands of digits long. These primes are central to modern cryptography and remain an active area of research in number theory.

A large prime is a prime number p>1p > 1 whose decimal representation contains sufficiently many digits that its primality cannot be verified by naive trial division alone, typically requiring specialized primality tests such as the Miller-Rabin or Lucas-Lehmer algorithms. While no formal digit threshold defines 'large,' the term generally refers to primes used in practical applications (100+ digits) or record-setting primes (millions of digits).

Key Formula

Mn=2n1M_n = 2^n - 1
Where:
  • MnM_n = A Mersenne number, which is prime only for certain values of n
  • nn = A positive integer (must itself be prime for M_n to have any chance of being prime)

How It Works

Finding large primes involves generating a candidate number and then testing whether it is prime. For numbers with hundreds of digits, you cannot simply check all possible divisors — there are far too many. Instead, mathematicians use probabilistic tests (like Miller-Rabin) that quickly determine if a number is *probably* prime, or deterministic tests (like Lucas-Lehmer) for special forms such as Mersenne primes 2n12^n - 1. The largest known primes are almost always Mersenne primes because this form allows efficient testing.

Worked Example

Problem: Verify that the Mersenne number M17=2171M_{17} = 2^{17} - 1 is prime.
Step 1: Compute the Mersenne number.
2171=1310721=1310712^{17} - 1 = 131072 - 1 = 131071
Step 2: To check primality, test divisibility by all primes up to 131071362\sqrt{131071} \approx 362. The primes to check are 2, 3, 5, 7, 11, ..., up to 359.
Step 3: None of these primes divide 131071 evenly. For example, 131071/718724.4131071 / 7 \approx 18724.4 and 131071/1111915.5131071 / 11 \approx 11915.5. Since no divisor is found, 131071 is prime.
Answer: M17=131071M_{17} = 131071 is a (Mersenne) prime. With only 6 digits it is small by modern standards, but the same Mersenne form 2n12^n - 1 has produced primes with over 41 million digits.

Why It Matters

Large primes are the backbone of RSA encryption, which secures online banking, messaging, and e-commerce. The security relies on the fact that multiplying two large primes is easy, but factoring their product back into those primes is computationally infeasible. Students studying number theory or pursuing careers in cybersecurity will encounter large primes repeatedly.

Common Mistakes

Mistake: Assuming 2n12^n - 1 is prime whenever nn is prime.
Correction: nn being prime is necessary but not sufficient. For example, n=11n = 11 is prime, but 2111=2047=23×892^{11} - 1 = 2047 = 23 \times 89 is composite. You must still run a primality test.