Ramanujan primes/twins: Difference between revisions

Content added Content deleted
(julia example)
(→‎{{header|Wren}}: Regularized the preamble.)
Line 255: Line 255:


=={{header|Wren}}==
=={{header|Wren}}==
{{trans|Phix}}
{{libheader|Wren-trait}}
{{libheader|Wren-trait}}
{{libheader|Wren-math}}
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
{{libheader|Wren-fmt}}
<br>
<br>
As calculating the first 1 million Ramanujan primes individually is out of the question, we follow the Phix entry's clever strategy here of which this is a partial translation.
As calculating the first 1 million Ramanujan primes individually is out of the question, we follow the Phix entry's clever strategy here which brings this task comfortably within our ambit.

The only reason this is faster than Phix (normally we'd be much slower) is because the basic Ramanujan code is a translation of the very fast C++ code for that task.
<lang ecmascript>import "/trait" for Stepped, Indexed
<lang ecmascript>import "/trait" for Stepped, Indexed
import "/math" for Int, Math
import "/math" for Int, Math