Calculate the sequence where each term an is the smallest natural number greater than the previous term, that has exactly n divisors.



Task
Show here, on this page, at least the first 15 terms of the sequence.



See also
 OEIS:A069654


Related tasks
 Sequence: smallest number with exactly n divisors
 Sequence: nth number with exactly n divisors‎‎


use strict;
use warnings;
use ntheory 'divisors';
 
print "First 15 terms of OEIS: A069654\n";
my $m = 0;
for my $n (1..15) {
    my $l = $m;
    while (++$l) {
        print("$l "), $m = $l, last if $n == divisors($l);
    }
}