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



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



Related tasks

 Sequence: smallest number greater than previous term with exactly n divisors
 Sequence: nth number with exactly n divisors‎‎


See also

 OEIS:A005179


import "/math" for Int
 
var limit = 22
var numbers = List.filled(limit, 0)
var i = 1
while (true) {
    var nd = Int.divisors(i).count
    if (nd <= limit && numbers[nd-1] == 0) {
        numbers[nd-1] = i
        if (numbers.all { |n| n > 0 }) break
    }
    i = i + 1
}
System.print("The first %(limit) terms are:")
System.print(numbers)