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.




  [ swap - -1 1 clamp 1+ ]       is <=>       ( n n --> n )
 
  [ dup * ]                      is squared   (   n --> n )
 
  [ dup squared * ]              is cubed     (   n --> n )
 
  0 0 []
  [ unrot 
    over squared
    over cubed <=>
    [ table 
      1+
      [ 1+ dip 1+ ]
      [ dip
         [ tuck squared
           join swap 1+ ] ] ]
    do
    rot dup size 30 = until ] 
  dip 2drop
  echo