Find the smallest n such that for any prime p, at least 20 numbers 1,2, ..., n are quadratic residues not modulo p.

k is quadratic residue modulo p if there exists an integer j such that j^2 ≡ k (mod p).