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.

  1. Use a loop to search for the first n prime numbers.
  2. In each step, multiply the new prime to your running product.
  3. Print the final integer result.

01EXAMPLE 1

Inputn = 3
Output30

Explanation: Product of {2, 3, 5}.

Constraints

  • Correct primality check loop.
  • Stop exactly after N primes.
MathLoopsPrimes
JavaScript
Loading...
3 Hidden

Input Arguments

n3

Expected Output

30

Click RUN to test your solution