## Largest number of k-arithmetic progressions without a (k+1)-arithmetic progression

Suppose $A \subseteq \{1,\dots,n\}$ does not contain any arithmetic progressions of length $k+1$. What is the largest number of $k$-term arithmetic progressions that $A$ can have? (one may also wish to put some lower or upper on the size of $A$) We can work over $\mathbb{Z}_p$ if it makes the answer any easier. The "degenerate" case $k=2$ asks for the largest size of the set without arithmetic progressions and it is known that there exist $A$'s with this property of almost linear size.

-
Nb. for graphs (i.e. asking for the maximal number of $l$-cliques a graph can contain before it contains a $k$-clique) there are explicit bounds. – Marcin Kotowski Mar 4 at 17:25
Dear Marcin This is nice and natural question, but I doubt if much is known. Did you look at the number of k-term APs in Berend-type examples for sets without (k+1)-terms arthmetic progressions? This looks like the best shot for an answer presently. – Gil Kalai Mar 6 at 7:27

Let $B\geq2k$ and let $$A=\left\{\sum_{i=0}^na_iB^i:n=0,1,...;a_i=0,1,...,k-1\right\}$$ It's not hard to show that $A$ has no $k+1$-long arithmetic progression. Using the density Hales-Jewett theorem we get that any subset $B\subset A$ with positive relative density has a $k$-long arithmetic progression.