Task

Show the first   30   positive integers which are squares but not cubes of such integers.

Optionally, show also the first   3   positive integers which are both squares and cubes,   and mark them as such.




            NORMAL MODE IS INTEGER
 
            CUBE=1
            NCUBE=1
            SQR=1
            NSQR=1
            SEEN=0
 
SQRLP       SQR = NSQR*NSQR
CUBELP      WHENEVER SQR.G.CUBE
                NCUBE = NCUBE+1
                CUBE = NCUBE*NCUBE*NCUBE
                TRANSFER TO CUBELP
            END OF CONDITIONAL
            WHENEVER SQR.NE.CUBE
                SEEN = SEEN+1
                PRINT FORMAT FMT,SQR
            END OF CONDITIONAL
            NSQR = NSQR+1
            WHENEVER SEEN.L.30, TRANSFER TO SQRLP
 
            VECTOR VALUES FMT = $I4*$
            END OF PROGRAM 