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


include "cowgol.coh";
 
# Get count of positive divisors of number
sub pos_div(num: uint16): (count: uint16) is
    count := 1;
    if num != 1 then
        var cur: uint16 := 1;
        while cur <= num/2 loop
            if num % cur == 0 then
                count := count + 1;
            end if;
            cur := cur + 1;
        end loop;
    end if;
end sub;
 
# Print first 100 Tau numbers
var nums: uint8 := 0;
var cur: uint16 := 0;
var col: uint16 := 10;
while nums < 100 loop
    cur := cur + 1;
    if cur % pos_div(cur) == 0 then
        print_i16(cur);
        col := col - 1;
        if col == 0 then
            print_nl();
            col := 10;
        else
            print_char('\t');
        end if;
        nums := nums + 1;
    end if;
end loop;