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


100H:
 
/* CP/M BDOS FUNCTIONS */
BDOS: PROCEDURE(F,A); DECLARE F BYTE, A ADDRESS; GO TO 5; END BDOS;
EXIT: PROCEDURE; GO TO 0; END EXIT;
PR$CHAR: PROCEDURE(C); DECLARE C BYTE; CALL BDOS(2,C); END PR$CHAR; 
PR$STR: PROCEDURE(S); DECLARE S ADDRESS; CALL BDOS(9,S); END PR$STR;
 
/* PRINT BYTE IN A 3-CHAR COLUMN */
PRINT3: PROCEDURE(N);
    DECLARE (N, M) BYTE;
    M = 100;
    DO WHILE M>0;
        IF N>=M
            THEN CALL PR$CHAR('0' + (N/M) MOD 10);
            ELSE CALL PR$CHAR(' ');
        M = M/10;
    END;
END PRINT3;
 
/* TAU FUNCTION */
TAU: PROCEDURE(N) BYTE;
    DECLARE (N, TOTAL, COUNT, P) BYTE;
    TOTAL = 1;
    DO WHILE NOT N; 
        N = SHR(N,1);
        TOTAL = TOTAL + 1;
    END;
    P = 3;
    DO WHILE P*P <= N;
        COUNT = 1;
        DO WHILE N MOD P = 0;
            COUNT = COUNT + 1;
            N = N / P;
        END;
        TOTAL = TOTAL * COUNT;
        P = P + 2;
    END;
    IF N>1 THEN TOTAL = SHL(TOTAL, 1);
    RETURN TOTAL;
END TAU;
 
/* PRINT TAU 1..100 */
DECLARE N BYTE;
DO N=1 TO 100;
    CALL PRINT3(TAU(N));
    IF N MOD 20=0 THEN CALL PR$STR(.(13,10,'$'));
END;
CALL EXIT;
EOF