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.




cube := [], counter:=0
while counter<30 {
	cube[(n := A_Index)**3] := true
	if !cube[n**2]
		counter++, res .= n**2 " "
	else
		res .= "[" n**2 "] "
}
MsgBox % Trim(res, " ")