50 lines
2.2 KiB
Text
50 lines
2.2 KiB
Text
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)
|
|
:;* <big><b>∙ ∙ ∙</b></big>
|
|
|
|
To express this mathematically, '''primorial<sub><big>''n''</big></sub>''' is
|
|
the product of the first <big>''n''</big> (successive) primes:
|
|
|
|
<big><big><big>
|
|
: <math>primorial_n = \prod_{k=1}^n prime_k</math>
|
|
</big></big>
|
|
:::::: ─── where <big><big><math>prime_k</math></big></big> is the <big><big>''k''<sup>''th''</sup>''</big></big> prime number.
|
|
</big>
|
|
|
|
|
|
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. <br>
|
|
|
|
|
|
;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]].
|
|
<br><br>
|
|
|