# Definition:Primorial

## Definition

There are two definitions for primorials: one for primes and one for positive integers.

### Definition for Primes

Let $p_n$ be the $n$th prime number.

Then the $n$th primorial $p_n \#$ is defined as:

$\ds p_n \# := \prod_{k \mathop = 1}^n p_k$

That is, $p_n \#$ is the product of the first $n$ primes.

### Definition for Positive Integers

Let $n$ be a positive integer.

Then:

$\ds n\# := \prod_{i \mathop = 1}^{\map \pi n} p_i = p_{\map \pi n}\#$

where $\map \pi n$ is the prime counting function.

That is, $n\#$ is defined as the product of all primes less than or equal to $n$.

Thus:

$n\# = \begin {cases} 1 & : n \le 1 \\ n \paren {\paren {n - 1}\#} & : \text {$n$prime} \\ \paren {n - 1}\# & : \text {$n$composite} \end {cases}$

## Examples

The first few primorials (of both types) are as follows:

 $\ds 0\# \ \$ $\ds = p_0 \#$ $=$ $\ds$ $\ds = 1$ $\ds 1\# \ \$ $\ds = p_0 \#$ $=$ $\ds$ $\ds = 1$ $\ds 2\# \ \$ $\ds = p_1 \#$ $=$ $\ds$ $\ds = 2$ $\ds 3\# \ \$ $\ds = p_2\#$ $=$ $\ds 2 \times 3$ $\ds = 6$ $\ds 4\# \ \$ $\ds = p_2\#$ $=$ $\ds 2 \times 3$ $\ds = 6$ $\ds 5\# \ \$ $\ds = p_3\#$ $=$ $\ds 2 \times 3 \times 5$ $\ds = 30$ $\ds 6\# \ \$ $\ds = p_3\#$ $=$ $\ds 2 \times 3 \times 5$ $\ds = 30$ $\ds 7\# \ \$ $\ds = p_4\#$ $=$ $\ds 2 \times 3 \times 5 \times 7$ $\ds = 210$ $\ds 8\# \ \$ $\ds = p_4\#$ $=$ $\ds 2 \times 3 \times 5 \times 7$ $\ds = 210$ $\ds 9\# \ \$ $\ds = p_4\#$ $=$ $\ds 2 \times 3 \times 5 \times 7$ $\ds = 210$ $\ds 10\# \ \$ $\ds = p_4\#$ $=$ $\ds 2 \times 3 \times 5 \times 7$ $\ds = 210$ $\ds 11\# \ \$ $\ds = p_5\#$ $=$ $\ds 2 \times 3 \times 5 \times 7 \times 11$ $\ds = 2310$ $\ds 12\# \ \$ $\ds = p_5\#$ $=$ $\ds 2 \times 3 \times 5 \times 7 \times 11$ $\ds = 2310$ $\ds 13\# \ \$ $\ds = p_6\#$ $=$ $\ds 2 \times 3 \times 5 \times 7 \times 11 \times 13$ $\ds = 30 \, 030$

The sequence contines:

$1, 2, 6, 30, 210, 2310, 30 \, 030, 510 \, 510, 9 \, 699 \, 690, 223 \, 092 \, 870, \ldots$