Lucas-Lehmer test: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) (→{{header|langur}}: added output and notes) |
(Added Quackery.) |
||
Line 2,985: | Line 2,985: | ||
Of course, they agree with [[oeis:A000043|OEIS A000043]]. |
Of course, they agree with [[oeis:A000043|OEIS A000043]]. |
||
=={{header|Quackery}}== |
|||
<code>eratosthenes</code> and <code>isprime</code> are defined at [[Sieve of Eratosthenes#Quackery]]. |
|||
<syntaxhighlight lang="Quackery"> [ dup temp put |
|||
dup bit 1 - |
|||
4 |
|||
rot 2 - times |
|||
[ dup * |
|||
dup temp share >> |
|||
dip [ over & ] + |
|||
2dup > not if |
|||
[ over - ] |
|||
2 - ] |
|||
0 = |
|||
nip temp release ] is l-l ( n --> b ) |
|||
25000 eratosthenes |
|||
[] 25000 times [ i^ isprime if [ i^ join ] ] |
|||
1 split |
|||
witheach |
|||
[ dup l-l iff join else drop ] |
|||
echo</syntaxhighlight> |
|||
{{out}} |
|||
<pre>[ 2 3 5 7 13 17 19 31 61 89 107 127 521 607 1279 2203 2281 3217 4253 4423 9689 9941 11213 19937 21701 23209 ]</pre> |
|||
=={{header|R}}== |
=={{header|R}}== |