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


proc divCount {n} {
    set cnt 0
    for {set d 1} {($d * $d) <= $n} {incr d} {
        if {0 == ($n % $d)} {
            incr cnt
            if {$d < ($n / $d)} {
                incr cnt
            }
        }
    }
    return $cnt
}
 
proc A005179 {n} {
    if {$n >= 1} {
        for {set k 1} {1} {incr k} {
            if {$n == [divCount $k]} {
                return $k
            }
        }
    }
    return 0
}
 
proc show {func lo hi} {
    puts "${func}($lo..$hi) ="
    for {set n $lo} {$n <= $hi} {incr n} {
        puts -nonewline " [$func $n]"
    }
    puts ""
}
 
show A005179 1 15
 