We determine the largest subset A⊆{1,…,n} such that for all a,b∈A, the product ab is not squarefree. Specifically, the maximum size is achieved by the complement of the odd squarefree numbers.
This resolves a problem of Paul Erdős and András Sárközy from 1992.