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


max := 15
seq := [], n := 0
while (n < max)
	if ((k := countDivisors(A_Index)) <= max) && !seq[k]
		seq[k] := A_Index, n++
for i, v in seq
	res .= v ", "
MsgBox % "The first " . max . " terms of the sequence are:`n" Trim(res, ", ")
return
 
countDivisors(n){
	while (A_Index**2 <= n)
		if !Mod(n, A_Index)
			count += A_Index = n/A_Index ? 1 : 2
	return count
}