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


MODULE TauNumbers;
FROM InOut IMPORT WriteCard, WriteLn;
 
CONST 
    MaxNum = 1100; (* enough to generate 100 Tau numbers *)
    NumTau = 100;  (* how many Tau numbers to generate *)
 
VAR DivCount: ARRAY [1..MaxNum] OF CARDINAL;
    seen, n: CARDINAL;
 
(* Find the amount of divisors for each number beforehand *)
PROCEDURE CountDivisors;
VAR i, j: CARDINAL;
BEGIN
    FOR i := 1 TO MaxNum DO
        DivCount[i] := 1; (* every number is divisible by 1 *)
    END;
 
    FOR i := 2 TO MaxNum DO
        j := i;
        WHILE j <= MaxNum DO (* J is divisible by I *)
            DivCount[j] := DivCount[j] + 1;
            j := j + i; (* next multiple of i *)
        END;
    END;
END CountDivisors;
 
BEGIN
    CountDivisors();
    n := 1;
    seen := 0;
    WHILE seen < NumTau DO
        IF n MOD DivCount[n] = 0 THEN
            WriteCard(n, 5);
            INC(seen);
            IF seen MOD 10 = 0 THEN
                WriteLn();
            END;
        END;
        INC(n);
    END;
END TauNumbers.