Euclid-Mullin sequence: Difference between revisions

m
(Added Easylang)
m (→‎{{header|Wren}}: Minor tidy)
 
Line 1,064:
===Wren-cli===
This uses the [https://en.wikipedia.org/wiki/Pollard%27s_rho_algorithm Pollard Rho algorithm] to try and speed up the factorization of the 15th element but overall time still slow at around 32 seconds.
<syntaxhighlight lang="ecmascriptwren">import "./big" for BigInt
 
var zero = BigInt.zero
Line 1,146:
 
If we could assume that Pollard's Rho will always find the smallest prime factor (or a multiple thereof) first, then this would bring the runtime down to 44 seconds and still produce the correct answers for this particular task. However, in general it is not safe to assume that - see discussion in Talk Page.
<syntaxhighlight lang="ecmascriptwren">/* euclid_mullin_gmpEuclid_mullin_sequence_2.wren */
 
import "./gmp" for Mpz
9,476

edits