Given an integer n, the primorial of n,
, is defined as product of all primes from 2 to the n-th prime. In other words, if
is the n-th prime number:
.
For this problem, we want to calculate the hyperprimorial of n, which we will define as:
.
For example:
From what we see above, calculating hyperprimorial will quickly involve extremely large integers, as such, please return only the last 6 digits of
. Therefore, in the example above the final output should be:
and
.
-----------------------------
NOTE: OEIS's "hyperprimorial" sequence, #A076265, is not the same as what is defined in this problem.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers1
Suggested Problems
-
2009 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3061 Solvers
-
Test if a Number is a Palindrome without using any String Operations
251 Solvers
-
714 Solvers
-
Divisible by n, prime divisors (including powers)
95 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!