Primorial primes: Difference between revisions
Content added Content deleted
(Created new draft task and added a Wren solution.) |
(J draft) |
||
Line 30: | Line 30: | ||
* [[Factorial_primes|Factorial primes]] |
* [[Factorial_primes|Factorial primes]] |
||
<br><br> |
<br><br> |
||
=={{header|J}}== |
|||
Compare with the [[Factorial_primes#J|j factorial prime]] implementation. |
|||
Columns here are primorial prime number cardinal number, primorial prime, primorial index number, and offset from the corresponding primorial to the prime: <lang J> P=: 1,*/\ p:i.15 NB. primorials represented as fixed width 64 bit integers |
|||
(,.~ #\)(,. (-{&P)/"1) (,. P I. <:) /:~(#~ 1 p: ]) ,P+/1 _1 |
|||
1 2 0 1 |
|||
2 3 1 1 |
|||
3 5 2 _1 |
|||
4 7 2 1 |
|||
5 29 3 _1 |
|||
6 31 3 1 |
|||
7 211 4 1 |
|||
8 2309 5 _1 |
|||
9 2311 5 1 |
|||
10 30029 6 _1 |
|||
11 200560490131 11 1 |
|||
12 304250263527209 13 _1</lang> |
|||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
===Basic=== |
===Basic=== |