Jump to content

Wagstaff primes: Difference between revisions

Added Quackery.
(Added Quackery.)
Line 1,186:
24: 5807 => [1748 digit number]
</pre>
 
=={{header|Quackery}}==
 
<code>from</code>, <code>incr</code>, and <code>end</code> are defined at [[Loops/Increment loop index within loop body#Quackery]].
 
<code>prime</code> is defined at [[Miller–Rabin primality test#Quackery]].
 
<syntaxhighlight lang="Quackery"> [ bit 1+ 3 / ] is wagstaff ( n --> n )
 
[] 3 from
[ 2 incr
index prime while
index wagstaff prime while
index join
dup size 24 = if end ]
10 split swap
witheach
[ dup say "p = " echo
wagstaff
say ", w(p) = " echo cr ]
witheach
[ say "p = " echo cr ]
</syntaxhighlight>
 
{{out}}
 
<pre>p = 3, w(p) = 3
p = 5, w(p) = 11
p = 7, w(p) = 43
p = 11, w(p) = 683
p = 13, w(p) = 2731
p = 17, w(p) = 43691
p = 19, w(p) = 174763
p = 23, w(p) = 2796203
p = 31, w(p) = 715827883
p = 43, w(p) = 2932031007403
p = 61
p = 79
p = 101
p = 127
p = 167
p = 191
p = 199
p = 313
p = 347
p = 701
p = 1709
p = 2617
p = 3539
p = 5807</pre>
 
=={{header|Raku}}==
1,462

edits

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