The Primorial Power
MediumAcc. 89.7%
+30 XP 12
Sequential Primes
The primorial $n#$ is the product of the first $n$ prime numbers. Example: $3# = 2 imes 3 imes 5 = 30$.
The Assignment
Your function receives a parameter n.
- Use a loop to search for the first
nprime numbers. - In each step, multiply the new prime to your running product.
- Print the final integer result.
01EXAMPLE 1
Input
n = 3Output
30Explanation: Product of {2, 3, 5}.
Constraints
- Correct primality check loop.
- Stop exactly after N primes.
MathLoopsPrimes
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
n3
Expected Output
30
Click RUN to test your solution