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.




10 DEFINT C,S,Q,R,N: C=1: S=1: Q=1: R=1: N=1
20 IF N>30 THEN END
30 S=Q*Q
40 IF S>C THEN R=R+1: C=R*R*R: GOTO 40
50 IF S<C THEN N=N+1: PRINT S;
60 Q=Q+1
70 GOTO 20