Primorial Calculator
Multiply the first n prime numbers to get the primorial, with the largest prime and factor count shown.
What it does
The primorial is the prime counterpart of the factorial. Instead of multiplying every integer up to n, it multiplies the first n prime numbers. The notation uses the prime count followed by a hash sign, as in p of n with a hash mark. The first few values are 1, 2, 6, 30, 210 and 2310.
Primorials appear in the study of prime gaps, in constructions of highly composite numbers, and in the search for long runs of consecutive composite integers. They are also useful when building numbers with many small prime factors.
Because primes thin out slowly, the nth primorial is much larger than n factorial for the same count. At n = 200 the result has several hundred digits, which is why the tool uses exact integer arithmetic throughout.
This page generates the first n primes, multiplies them and reports the product together with the largest prime used and the count of factors. The search for primes is bounded, so the page cannot loop without end.
The input limit is 200 primes. That keeps the printed value long but still readable, and the computation returns immediately in a browser.
How to use
- Enter the number of primes n from 0 to 200.
- Read the primorial value in the main result box.
- Check the largest prime that was multiplied in.
- Use the factor count to confirm how many primes were used.
- The default n = 5 reproduces the worked example.
- Try n = 10 to confirm the value 6,469,693,230.
Formula
- n
- How many initial primes to multiply.
- p_i
- The ith prime number.
- p(n)#
- The primorial, or product of those primes.
The empty product for n = 0 is defined as 1. Each prime appears once, so a primorial is always squarefree. The asymptotic size grows like e raised to roughly n times the natural log of n, which outpaces the factorial function.
Worked example
Example: first five primes
The page opens with n = 5.
- List the first five primes: 2, 3, 5, 7 and 11.
- Multiply the first two: 2 x 3 = 6.
- Multiply by 5 to get 30.
- Multiply by 7 to get 210.
- Multiply by 11 to get 2,310.
- The tool reports 2310, largest prime 11 and factor count 5.
- For n = 10 the product reaches 6,469,693,230.
Reference table
| n | p(n)# | Largest prime |
|---|---|---|
| 0 | 1 | n/a |
| 1 | 2 | 2 |
| 2 | 6 | 3 |
| 3 | 30 | 5 |
| 5 | 2310 | 11 |
| 10 | 6469693230 | 29 |
Limits
- The input counts primes, not integers.
- Counts above 200 are rejected to keep the printed value short.
- The tool does not test the primorial for primality; it is always composite for n at least 2.
- The prime search has a guard so it cannot run indefinitely.
Common mistakes
- Multiplying every integer up to n instead of the first n primes.
- Taking p(0)# to be zero rather than one.
- Repeating a prime when a prime power was intended.
- Confusing the count n with the largest prime used.
- Using a floating point product and losing digits.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is the product of the first five primes?
2 x 3 x 5 x 7 x 11 = 2310.
What is p(0)#?
It is 1, the empty product.
What is p(10)#?
It is 6,469,693,230, with largest factor 29.
Questions
How does a primorial differ from a factorial?
A factorial multiplies every integer up to n, while a primorial multiplies the first n primes.
Is a primorial ever prime?
Only p(1)# = 2. For larger counts the result has several prime factors.
Why is p(0)# equal to 1?
By the standard convention for an empty product.
Where are primorials useful?
In prime gap constructions, highly composite numbers and covering systems.
Are the values exact?
Yes. The multiplication uses arbitrary precision integers.
What is the largest count accepted?
Two hundred primes.