Perfect squares and powers