Sequence: smallest number with exactly n divisors: Difference between revisions
Sequence: smallest number with exactly n divisors (view source)
Revision as of 19:37, 22 March 2023
, 1 year agoAdd Miranda
(Added PROMAL) |
Not a robot (talk | contribs) (Add Miranda) |
||
Line 1,022:
14 192
15 144</pre>
=={{header|Miranda}}==
<syntaxhighlight lang="miranda">main :: [sys_message]
main = [Stdout (show (take 15 a005179) ++ "\n")]
a005179 :: [num]
a005179 = map smallest_n_divisors [1..]
smallest_n_divisors :: num->num
smallest_n_divisors n = hd [i | i<-[1..]; n = #divisors i]
divisors :: num->[num]
divisors n = [d | d<-[1..n]; n mod d=0]</syntaxhighlight>
{{out}}
<pre>[1,2,4,6,16,12,64,24,36,48,1024,60,4096,192,144]</pre>
=={{header|Modula-2}}==
|