1 ! Copyright (C) 2007-2009 Samuel Tardieu.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel lists.lazy math math.primes ;
6 : lprimes ( -- list ) 2 [ next-prime ] lfrom-by ;
8 : lprimes-from ( n -- list )
9 dup 3 < [ drop lprimes ] [ 1- next-prime [ next-prime ] lfrom-by ] if ;