The recognition problem for the set of perfect squares