Jump to content

Factors of an integer: Difference between revisions

m
(→‎{{header|PureBasic}}: Added PureBasic)
Line 701:
=={{header|Ursala}}==
Filter the sequence of numbers from 1 to n according to divisibility into n.
<lang Ursala>#import std
#import std
#import nat
 
factors "n" = (not remainder/"n")*~@t iota successor nrange(1,"n")</lang>
</lang>
test program:
<lang Ursala>#cast %nL
#cast %nL
 
example = factors 100</lang>
</lang>
output:
<pre><1,2,4,5,10,20,25,50,100></pre>
<pre>
<1,2,4,5,10,20,25,50,100>
</pre>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.