This is a refined version of a [question I have recently posted][2].

For a prime $p$, let $\varphi_p\colon\mathbb Z\to\mathbb Z/p\mathbb Z$ denote the canonical homomorphism from the integers onto the group of order $p$. 

> Given an integer $n\ge 3$, what is the smallest $\varepsilon=\varepsilon(n)>0$ such that for any subset $A\subset\mathbb Z$ with $|A|=n$, not contained in an arithmetic progression with the difference greater than $1$, there exists a prime $p$ satisfying $(1-\varepsilon(n))n<|\varphi_p(A)|<n$?

To put it simply, I want a prime $p$ distinguishing between the elements of $A$ ``as much as possible", but not distinguishing between all of them - subject to the assumption that $A$ is not contained in a nontrivial arithmetic progression (see [this nice construction][1] by Peter Mueller showing that the containment assumption is vital.).


  [1]: https://mathoverflow.net/a/446470/9924
  [2]: https://mathoverflow.net/q/446461/9924