Generate and show here, the first twenty Perfect totient numbers.



Related task

   Totient function


Also see

   the OEIS entry for   perfect totient numbers.
   mrob   list of the first 54


            NORMAL MODE IS INTEGER
 
            INTERNAL FUNCTION(Y,Z)
            ENTRY TO GCD.
            A = Y
            B = Z
LOOP        WHENEVER A.E.B, FUNCTION RETURN A
            WHENEVER A.G.B, A = A-B 
            WHENEVER A.L.B, B = B-A
            TRANSFER TO LOOP
            END OF FUNCTION
 
            INTERNAL FUNCTION(C)
            ENTRY TO TOTENT.
            E = 0
            THROUGH LOOP, FOR D=1, 1, D.GE.C
LOOP        WHENEVER GCD.(C,D).E.1, E = E+1
            FUNCTION RETURN E
            END OF FUNCTION
 
            INTERNAL FUNCTION(G)
            ENTRY TO PERFCT.
            H = G
            I = 0
LOOP        H = TOTENT.(H)
            I = I+H
            WHENEVER H.G.1, TRANSFER TO LOOP
            FUNCTION RETURN I.E.G
            END OF FUNCTION
 
            SEEN = 0
            THROUGH LOOP, FOR N=3, 2, SEEN.GE.20
            WHENEVER PERFCT.(N)
                SEEN = SEEN+1
                PRINT FORMAT FMT,N
            END OF CONDITIONAL
LOOP        CONTINUE
 
            VECTOR VALUES FMT = $I9*$
            END OF PROGRAM 