Paste: Tracking down UNIX signal #8 (SIGFPE)
Author: | Loryn Jenkins |
Mode: | factor |
Date: | Tue, 5 Mar 2013 06:53:03 |
Plain Text |
: next ( x -- x+1 )
1 + ;
:: iota-replacement ( max -- seq )
0 [ next dup max < ] [ dup ] produce nip ;
:: candidates-1a ( target -- seq )
target iota >array
[ target swap mod 0 = ] filter ;
:: candidates-1b ( target -- seq )
target primes-upto >array
[ target swap mod 0 = ] filter ;
:: candidates-2ai ( target -- seq )
target iota >array
[ target swap divisor? ] filter ;
:: candidates-2aii ( target -- seq )
target iota-replacement >array
[ target swap divisor? ] filter ;
:: candidates-2b ( target -- seq )
target primes-upto >array
[ target swap divisor? ] filter ;
New Annotation