Deceptive numbers: Difference between revisions
Content deleted Content added
Add Factor |
|||
Line 38:
<br>
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
<lang factor>USING: io kernel lists lists.lazy math math.functions
math.primes prettyprint ;
: repunit ( m -- n ) 10^ 1 - 9 / ;
: composite ( -- list ) 4 lfrom [ prime? not ] lfilter ;
: deceptive ( -- list )
composite [ [ 1 - repunit ] keep divisor? ] lfilter ;
10 deceptive ltake [ pprint bl ] leach nl</lang>
{{out}}
<pre>
91 259 451 481 703 1729 2821 2981 3367 4141
</pre>
=={{header|Julia}}==
|