Definition:Primorial

Definition
There are two definitions for primorials, one for primes and one for natural numbers.

Definition for Primes
Let $p_n$ be the $n$th prime number.

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


 * $\displaystyle p_n \# := \prod_{i=1}^n p_k$

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

Definition for Natural Numbers
Let $n$ be a natural number.

Then:
 * $\displaystyle n\# := \prod_{i=1}^{\pi \left({n}\right)} p_i = p_{\pi \left({n}\right)}\#$

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

Thus:
 * $n\# = \begin{cases}

0 & : n \le 1 \\ n \left({\left({n-1}\right)\#}\right) & : n \mbox { prime} \\ \left({n-1}\right)\# & : n \mbox { composite} \end{cases}$

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