June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
6
Task/Pernicious-numbers/Factor/pernicious-numbers.factor
Normal file
6
Task/Pernicious-numbers/Factor/pernicious-numbers.factor
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
USING: lists lists.lazy math.bits math.primes math.ranges ;
|
||||
|
||||
: pernicious? ( n -- ? ) make-bits [ t = ] count prime? ;
|
||||
|
||||
0 lfrom [ pernicious? ] lfilter 25 swap ltake list>array . ! print first 25 pernicious numbers
|
||||
888,888,877 888,888,888 [a,b] [ pernicious? ] filter . ! print pernicious numbers in range
|
||||
Loading…
Add table
Add a link
Reference in a new issue