Primorial numbers are those formed by multiplying successive prime numbers.
The primorial number series is:
::* primorial(0) = 1 (by definition)
::* primorial(1) = 2 (2)
::* primorial(2) = 6 (2×3)
::* primorial(3) = 30 (2×3×5)
::* primorial(4) = 210 (2×3×5×7)
::* primorial(5) = 2310 (2×3×5×7×11)
::* primorial(6) = 30030 (2×3×5×7×11×13)
:;* ∙ ∙ ∙
To express this mathematically, '''primorial''n''''' is
the product of the first ''n'' (successive) primes:
:
:::::: ─── where is the ''k''''th'''' prime number.
In some sense, generating primorial numbers is similar to factorials.
As with factorials, primorial numbers get large quickly.
;Task:
* Show the first ten primorial numbers (0 ──► 9, inclusive).
* Show the length of primorial numbers whose index is: 10 100 1,000 10,000 and 100,000.
* Show the length of the one millionth primorial number (optional).
* Use exact integers, not approximations.
By ''length'' (above), it is meant the number of decimal digits in the numbers.
;Related tasks:
* [[Sequence of primorial primes]]
* [[Factorial]]
* [[Fortunate_numbers]]
;See also:
* the MathWorld webpage: [http://mathworld.wolfram.com/Primorial.html primorial]
* the Wikipedia webpage: [[wp:Primorial|primorial]].
* the OEIS webpage: [[oeis:A002110|A002110]].