Jump to content

Sequence of primorial primes: Difference between revisions

added Arturo
m (syntax highlighting fixup automation)
(added Arturo)
Line 137:
12: 13# - 1 = 304250263527209
</pre>
 
=={{header|Arturo}}==
<syntaxhighlight lang="arturo">productUpTo: #["1": 1]
primorials: unique map 2..4000 'x ->
productUpTo\[x]: <= productUpTo\[x-1] * (prime? x)? -> x -> 1
 
primorials | map.with:'i 'x -> @[i x]
| select.first:20 'x -> or? [prime? x\1 + 1][prime? x\1 - 1]
| map 'x -> x\0 + 1
| print</syntaxhighlight>
 
{{out}}
 
<pre>1 2 3 4 5 6 11 13 24 66 68 75 167 171 172 287 310 352 384 457</pre>
 
=={{header|C}}==
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.