! Copyright (C) 2007-2009 Samuel Tardieu.
! See http://factorcode.org/license.txt for BSD license.
-USING: combinators combinators.short-circuit fry kernel locals
+USING: combinators combinators.short-circuit kernel
math math.bitwise math.functions math.order math.primes.erato
-math.primes.erato.private math.primes.miller-rabin math.ranges
+math.primes.erato.private math.primes.miller-rabin ranges
literals random sequences sets vectors ;
IN: math.primes
: nprimes ( n -- seq )
2 swap [ [ next-prime ] keep ] replicate nip ;
-: coprime? ( a b -- ? ) fast-gcd 1 = ; foldable
+: coprime? ( a b -- ? ) simple-gcd 1 = ; foldable
: random-prime ( numbits -- p )
[ ] [ 2^ ] [ random-bits* next-prime ] tri