Sequence: smallest number with exactly n divisors: Difference between revisions

Content added Content deleted
m (Tidy heading)
(→‎{{header|Perl}}: Move task entry)
Line 14:
:*[[Sequence: smallest number greater than previous term with exactly n divisors]]
:*[[Sequence: nth number with exactly n divisors‎‎]]
 
=={{header|Perl}}==
{{libheader|ntheory}}
<lang perl>use strict;
use warnings;
use ntheory 'divisors';
 
print "First 15 terms of OEIS: A005179\n";
for my $n (1..15) {
my $l = 0;
while (++$l) {
print "$l " and last if $n == divisors($l);
}
}</lang>
{{out}}
<pre>First 15 terms of OEIS: A005179
1 2 4 6 16 12 64 24 36 48 1024 60 4096 192 144</pre>
 
=={{header|Perl 6}}==