Circular primes: Difference between revisions

m
→‎{{header|J}}: more concise definition for R (the rest is a bit verbose, but leaving it alone for now)
No edit summary
m (→‎{{header|J}}: more concise definition for R (the rest is a bit verbose, but leaving it alone for now))
Line 1,254:
<syntaxhighlight lang="j">
 
R=: [:10x "#. 'x' ,~ #&'1'
assert 11111111111111111111111111111111x -: R 32
 
Line 1,325:
<pre>
Note 'The current Miller-Rabin test implemented in c is insufficient for this task'
R=: ([:10x "#. 'x' ,~ #&'1')&>
(;q:@R)&> 500
|limit error
Line 1,334:
Filter=: (#~`)(`:6)
 
R=: ([:10x "#. 'x' ,~ #&'1')&>
(; q:@R)&> (0 ~: 3&|)Filter >: i. 26 NB. factor some repunits
┌──┬─────────────────────────────────┐
Line 1,376:
NB. R(2) R(19), R(23) are probably prime.
</pre>
 
=={{header|Java}}==
<syntaxhighlight lang="java">import java.math.BigInteger;
6,962

edits