Given a positive integer, count the number of its positive divisors.



Task
Show the result for the first   100   positive integers.



Related task
  Tau number


func divisorCount(number) {
    var n = number
    var total = 1
 
    while (n &&& 1) == 0 {
        total += 1
        n >>>= 1
    }
 
    var p = 3
    while p * p <= n {
        var count = 1
        while n % p == 0 {
            count += 1
            n /= p
        }
        total *= count
        p += 2
    }
 
    if n > 1 {
        total *= 2
    }
 
    total
}
 
let limit = 100
print("Count of divisors for the first \(limit) positive integers:")
for n in 1..limit {
    print(divisorCount(number: n).ToString().PadLeft(2, ' ') + " ", terminator: "")
    print() when n % 20 == 0
}