In [this math.stackexchange question](https://math.stackexchange.com/q/4668840/111012) Adam Rubinson asked (I paraphrase):



> 
> Given a natural number $r$, what is the least number $n$ such that every strictly increasing sequence of $n$ real numbers has a subsequence $x\_1,x\_2,\dots,x\_r$ of length $r$ whose sequence of differences $x\_2-x\_1,x\_3-x\_2,\dots,x\_r-x\_{r-1}$ is (nonstrictly) monotonic? (E.g., if $r=4$ then $n=7$.)
> 
> 
> 


I can't recall having seen this before, but it seems like a reasonably natural question, so it must be discussed somewhere in the literature. Where?


**Edit.** I'm not sure the question should be closed as a duplicate, seeing as I posted it as a reference request, and I still don't know where or whether this result appears as a traditional publication.


I would have expected this to be a "classical" problem. It's hard to believe that it's not among the thousands of problems Paul Erdős wrote about.



A combinatorial problem about sequences of numbers
As pointed out in a comment by [Vladimir Dotsenko](https://mathoverflow.net/users/1306/vladimir-dotsenko), the problem I asked about was posed and solved in the classical paper by Erdős and Szekeres, A combinatorial problem in geometry, *Compositio Math.* 2 (1935), 463–470 ([pdf](http://www.numdam.org/item/CM_1935__2__463_0.pdf)); see the discussion beginning with "We solve now a similar problem" on p. 468.


In another comment [Darij Grinberg](https://mathoverflow.net/users/2530/darij-grinberg) pointed out that a generalization to possibly non-monotonic sequences was the subject of a 2012 [math overflow question](https://mathoverflow.net/questions/90128/erd%C5%91s-szekeres-for-first-differences) by [Seva](https://mathoverflow.net/users/9924/seva) which was answered by [Sergey Norin](https://mathoverflow.net/users/8733/sergey-norin).


