Primorial Number Calculator
Calculate prime products and inspect the factors, divisors, and digits of a primorial
Introduction: Understanding Primorial Numbers
A primorial is a number formed by multiplying successive primes, rather than every positive integer as in a factorial. It may be denoted by p# when p is the last included prime, or by P_n when the first n primes are used. This calculator uses the indexed form: enter n and it returns the product of primes from 2 through the n-th prime, together with its factor list, divisor count, and digit count.
The sequence begins 2, 6 (2 × 3), 30 (2 × 3 × 5), 210 (2 × 3 × 5 × 7), and 2,310 (2 × 3 × 5 × 7 × 11). Because every new term appends one previously unused prime factor, primorials are useful examples of squarefree integers and of the way primes accumulate in products. They also give a compact setting for studying divisibility and prime-factor structure.
Primorial Definition and Notation
Primorial (p#): For a prime p, p# is the product of every prime less than or equal to p. Thus, 7# = 2 × 3 × 5 × 7 = 210.
Primorial by Index (P_n): P_n is the product of the first n primes. For example, P_4 = 2 × 3 × 5 × 7 = 210, so it is the same value as 7#.
Squarefree structure: Each included prime occurs exactly once in a primorial. Consequently, no prime square divides P_n, and every positive divisor is made by choosing a subset of its n prime factors. This distinguishes a primorial from n!, whose factorization includes repeated primes.
Primorial Number Formula
The indexed primorial calculated on this page is the product of the first n prime numbers:
Here p_i is the i-th prime. The calculator generates those primes in order and multiplies them, so increasing n by one multiplies the preceding result by p_n. Every earlier primorial therefore divides every later one. The displayed factor list is not a separate factorization attempt; it is the same ordered list of primes used to build the product.
Worked Example: Computing Primorial P_5
This primorial example uses index 5, meaning that the calculator includes the first five primes.
Step 1: Identify the first 5 prime numbers:
- p_1 = 2
- p_2 = 3
- p_3 = 5
- p_4 = 7
- p_5 = 11
Step 2: Multiply all primes sequentially:
- P_1 = 2
- P_2 = 2 × 3 = 6
- P_3 = 6 × 5 = 30
- P_4 = 30 × 7 = 210
- P_5 = 210 × 11 = 2,310
Step 3: Check the primorial factorization:
P_5 = 2,310 contains one copy each of 2, 3, 5, 7, and 11. Since each of the five primes can either be included or omitted when forming a divisor, P_5 has (1 + 1)^5 = 32 positive divisors, including 1 and 2,310.
Comparison with a factorial: The relevant comparison depends on the index and is not an ordering rule: 5! = 120 while P_5 = 2,310. A factorial includes all integers through n, whereas P_n includes the first n primes, whose last factor is larger than n once n exceeds 2.
Mathematical Properties of Primorials
Primorials have several direct properties that follow from their distinct prime factors.
Divisibility Chain: Each primorial is divisible by every previous primorial: P_n divides P_(n+1), P_(n+2), and so on. Adding the next prime never removes an earlier factor.
Divisor Count: The number of positive divisors of P_n is 2^n, because each of the n distinct prime factors has exponent one. Thus P_5 has 32 divisors and P_6 has 64.
Growth: Primorials increase rapidly because each step multiplies by a new prime. For example, P_10 = 6,469,693,230. The number of digits and the product itself both rise as the entered index rises, which is why the calculator limits the index to a manageable range.
Euclid's Theorem Connection: If a finite list of primes is multiplied together and 1 is added, the resulting number has no divisor from that list. Any prime divisor of the new number must therefore be a different prime. This is the central observation in Euclid-style proofs that there are infinitely many primes; a primorial is one natural product to use in that construction.
Applications of Primorials
Primorials are primarily useful as number-theory objects and as test cases for calculations involving many distinct small prime factors.
Number Theory: Products of initial primes occur in discussions of coprimality, sieves, residue classes, and estimates related to the distribution of primes.
Modular Arithmetic: Because a primorial is divisible by every prime through its final factor, it provides a common modulus for examining which residue classes can contain numbers coprime to those small primes.
Algorithm Testing: A known squarefree factorization makes primorials convenient inputs when checking routines that list factors, count divisors, or work with products of primes.
Prime Gap Context: Numbers one more or one less than a primorial are not divisible by any of its included primes. That observation is useful when constructing examples for elementary discussions of prime candidates, although it does not by itself make the neighboring number prime.
Practical Context for Primorial Numbers
Primorial calculations are most practical as transparent examples of exact integer arithmetic. The product and its complete prime factor list are known from the chosen index, so the result can be checked by multiplying the displayed factors or by comparing it with the next and previous index. This makes the calculator useful for coursework, exploratory number theory, and verifying small sequence values.
They can also illustrate why factorization data matters. A large-looking integer is easy to describe once its prime factors are known, while recovering those factors from an arbitrary integer can be much harder. A primorial starts with the factorization supplied by definition: it contains each selected prime once and no other prime factors.
Primorials in Mathematical History
Primorial-style products are closely associated with the classical argument for infinitely many primes. Euclid's proof does not require modern primorial notation: it begins with any proposed finite list of primes, multiplies them, and considers one more than that product. The notation p# is a later compact way to refer to the product of all primes up to p.
In modern number theory, products of small primes remain useful in sieve methods and in arguments about integers that avoid particular prime divisors. The primorial sequence itself is also a straightforward reference sequence for studying squarefree numbers, divisor functions, and the contrast between prime products and factorial products.
Computing Primorial Products
This primorial calculator first finds the requested number of primes and then multiplies them in sequence. For the supported indices, this direct approach is easy to audit: the factors shown in the result are precisely the values used in the product. No estimate of a prime or approximation of the product is needed.
For much larger indices, the same mathematical definition applies but the integers quickly become long. Efficient large-scale implementations may use prime-generation methods and multiprecision integer arithmetic. The main challenge is representing and multiplying increasingly large exact integers, rather than deciding which factors belong in a primorial.
Primorial Calculator Limits and Result Checks
This calculator accepts a prime index from 1 through 20 and uses exact integer arithmetic for the displayed primorial. The divisor count is 2^n because the result has n distinct prime factors, and the digit count is taken from the resulting integer. Check that the index is the number of primes wanted—not the value of the final prime—before using the result.
For a quick primorial check, compare neighboring indices: moving from P_n to P_(n+1) should multiply the value by the next prime in the displayed factor sequence. If you need a product beyond the supported range, use software designed for larger arbitrary-precision integer calculations and retain the complete prime list used in the product.
First 10 Primorial Numbers
The first ten indexed primorials show the prime added at each step, the resulting product, and its divisor count.
| Index (n) | Prime (p_n) | Primorial P_n | Divisors (2^n) | vs n! |
|---|---|---|---|---|
| 1 | 2 | 2 | 2 | > 1! (1) |
| 2 | 3 | 6 | 4 | > 2! (2) |
| 3 | 5 | 30 | 8 | > 3! (6) |
| 4 | 7 | 210 | 16 | > 4! (24) |
| 5 | 11 | 2,310 | 32 | > 5! (120) |
| 6 | 13 | 30,030 | 64 | > 6! (720) |
| 7 | 17 | 510,510 | 128 | > 7! (5,040) |
| 8 | 19 | 9,699,690 | 256 | > 8! (40,320) |
| 9 | 23 | 223,092,870 | 512 | > 9! (362,880) |
| 10 | 29 | 6,469,693,230 | 1,024 | > 10! (3.6M) |
How to use this primorial calculator
- Enter the number of initial primes to include as Prime Index (n, 1-20).
- Calculate the primorial, then confirm that the listed prime factors match the first n primes and that the divisor count is 2^n.
Primorial Calculator
Arcade Mini-Game: Primorial Number Calculator Calibration Run
Use this quick primorial-themed arcade run to identify the valid prime-index input before calculating a product of initial primes.
Start the game, then use your pointer or arrow keys to catch the valid prime-index input and avoid unsuitable entries.
