Sequence of primorial primes: Difference between revisions

Line 2,409:
 
<pre>1 2 3 4 5 6 11 13 24 66 68 75 167 171 172 287 310 352 384 457</pre>
 
=={{header|Julia}}==
{{trans|Go}}
<lang julia>using Primes
 
function primordials(N)
print("The first $N primorial indices sequentially producing primorial primes are: 1 ")
primorial = 1
count = 1
p = 3
prod = BigInt(2)
while(true)
if isprime(p)
prod *= p
primorial += 1
if isprime(prod + 1) || isprime(prod - 1)
print("$primorial ")
count += 1
if count == N
break
end
end
end
p += 2
end
end
 
primordials(20)
</lang>{{output}}<pre>
The first 20 primorial indices sequentially producing primorial primes are: 1 2 3 4 5 6 11 13 24 66 68 75 167 171 172 287 310 352 384 457
</lang>
 
 
=={{header|Kotlin}}==
4,102

edits