begin;
    comment 
    		321.A60:			OCT '90
    		ERIK SCHOENFELDER
    
    		THIS IS THE
    			0. START WITH A NATURAL NUMBER N.
    			1. IF N IS ODD, SET N TO BE 3 * N + 1
    			   IF N IS EVEN, SET N TO BE N / 2
    			   REPEAT STEP 1 UNTIL N IS EQUAL 1.
    			2. PRINT THE NUMBER OF REPETITONS.
    		FUN.
    		AND: WHO KNOWS, IF THIS TERMIMATES FOR ANY N...
    	
    ;
    integer procedure DOIT(N); 
      value N;
      integer N;
    begin;
        Boolean procedure ODD(X); 
          value X;
          integer X;
        ODD := N NOTEQUAL (N ÷ 2) TIMES 2;
        integer COUNT;
        COUNT := 0;
        DO: if ODD(N) then N := 3 TIMES N + 1 else N := N ÷ 2;
        COUNT := COUNT + 1;
        if N NOTEQUAL 1 then goto DO;
        DOIT := COUNT;
    end ;
    integer I, N, VAL, MAX, NN;
    NN := 12;
    VPRINT("HI!\N                N           ITERATIONS\N");
    for I := 1 step 1 until NN do
      VPRINT(I, DOIT(I));
    VPRINT("...");
    VPRINT("\NNOW LOOKING FOR MAXIMA:");
    VPRINT("\N                N           ITERATIONS\N");
    N := 0;
    MAX := -1;
    for I := 1 step 1 until NN do
      begin;
        DO: N := N + 1;
        VAL := DOIT(N);
        if VAL NOTLESS MAX then goto DO;
        VPRINT(N, VAL);
        MAX := VAL;
    end ;
    VPRINT("...\NDONE.");
end ;