A Tau number is a positive integer divisible by the count of its positive divisors.



Task
Show the first   100   Tau numbers.
The numbers shall be generated during run-time (i.e. the code may not contain string literals, sets/arrays of integers, or alike).



Related task
  Tau function


 
# syntax: GAWK -f TAU_NUMBER.AWK
BEGIN {
    print("The first 100 tau numbers:")
    while (count < 100) {
      i++
      if (i % count_divisors(i) == 0) {
        printf("%4d ",i)
        if (++count % 10 == 0) {
          printf("\n")
        }
      }
    }
    exit(0)
}
function count_divisors(n,  count,i) {
    for (i=1; i*i<=n; i++) {
      if (n % i == 0) {
        count += (i == n / i) ? 1 : 2
      }
    }
    return(count)
}
 