Factors of an integer: Difference between revisions

Content added Content deleted
(→‎{{header|PureBasic}}: Added PureBasic)
Line 701: Line 701:
=={{header|Ursala}}==
=={{header|Ursala}}==
Filter the sequence of numbers from 1 to n according to divisibility into n.
Filter the sequence of numbers from 1 to n according to divisibility into n.
<lang Ursala>
<lang Ursala>#import std
#import std
#import nat
#import nat


factors "n" = (not remainder/"n")*~@t iota successor "n"
factors "n" = (not remainder/"n")*~ nrange(1,"n")</lang>
</lang>
test program:
test program:
<lang Ursala>
<lang Ursala>#cast %nL
#cast %nL


example = factors 100
example = factors 100</lang>
</lang>
output:
output:
<pre><1,2,4,5,10,20,25,50,100></pre>
<pre>
<1,2,4,5,10,20,25,50,100>
</pre>