The famous Green-Tao theorem says that there exist arbitrarily long sequences of primes in arithmetic progression. I am wondering: How dense can a subset $S \subset \mathbb{N}$ be and still avoid arbitrarily long sequences of elements of $S$ in arithmetic progression? To make this more precise (following a comment by Robert Israel),
Q. What is the cardinality of the largest subset $S_n$ of $[1,n]=\{1,2,3,\ldots,n\}$ that avoids $k$-term arithmetic progressions of elements in $S_n$, as a function of $n$ and $k$?
As $n \to \infty$, can the density be significantly more dense than the primes density, $n / \log_e n$?
I suspect this is a well-studied question, in which case quotes and/or pointers would suffice. Thanks!