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


get "libhdr"
 
// Count the divisors of 1..N
let divcounts(v, n) be
$(  // Every positive number is divisible by 1
    for i=1 to n do v!i := 1;
    for i=2 to n do 
    $(  let j = i
        while j <= n do
        $(  // J is divisible by I
            v!j := v!j + 1
            j := j + i
        $)
    $)
$)
 
// Given a stored vector of divisors counts, is a number a tau number?
let tau(v, i) = i rem v!i = 0
 
let start() be
$(  let dvec = vec 1100
    let n, seen = 1, 0
 
    divcounts(dvec, 1100) // find amount of divisors for each number
    while seen < 100 do
    $(  if tau(dvec, n) then
        $(  writed(n, 5)
            seen := seen + 1
            if seen rem 10 = 0 then wrch('*N')
        $)
        n := n + 1
    $)
$)