Problem: A finite sequence of integers $a_1, a_2, \dots, a_n$ is called
\emph{regular} if there exists a real number $x$ satisfying
\[ \left\lfloor kx \right\rfloor = a_k \quad \text{for } 1 \le k \le n. \]
Given a regular sequence $a_1, a_2, \dots, a_n$, for $1 \le k \le n$ we say that
the term $a_k$ is \emph{forced} if the following condition is satisfied:
the sequence \[ a_1, \; a_2, \; \dots, \; a_{k-1}, \; b \]
is regular if and only if $b = a_k$.

Find the maximum possible number of forced terms
in a regular sequence with $1000$ terms.

Solution: The answer is $985$. WLOG, by shifting $a_1 = 0$ (clearly $a_1$ isn't forced).
Now, we construct regular sequences inductively using the following procedure.
Start with the inequality \[ \tfrac01 \le x < \tfrac11. \]
Then for each $k = 2, 3, \dots, 1000$ we perform the following procedure.
If there is no fraction of the form $F = \frac mk$ in the interval $A \le x < B$,
then $a_k$ is forced,
and the interval of possible $x$ values does not change.
Otherwise, $a_k$ is not forced,
and we pick a value of $a_k$ and update the interval accordingly.

The theory of \href{https://en.wikipedia.org/wiki/Farey_sequence}{Farey sequences}
tells us that when we have a stage $\tfrac ab \le x < \tfrac cd$
then the next time we will find a fraction
in that interval is exactly $\tfrac{a+c}{b+d}$ (at time $k=b+d$),
and it will be the only such fraction.

So essentially, starting with $\tfrac 01 \le x < \tfrac 11$
we repeatedly replace one of the endpoints of the intervals with the mediant,
until one of the denominators exceeds $1000$;
we are trying to minimize the number of non-forced terms,
which is the number of denominators that appear in this process.
It is not hard to see that this optimum occurs by always replacing the smaller of the denominators,
so that the sequence is
\begin{align*}
 \tfrac{0}{1} &\le x < \tfrac{1}{1} \\
 \tfrac{0}{1} &\le x < \tfrac{1}{2} \\
 \tfrac{1}{3} &\le x < \tfrac{1}{2} \\
 \tfrac{1}{3} &\le x < \tfrac{2}{5} \\
 \tfrac{3}{8} &\le x < \tfrac{2}{5} \\
 \tfrac{3}{8} &\le x < \tfrac{5}{13}
\end{align*}
and so on; we see that the non-forced terms in this optimal configuration
are exactly the Fibonacci numbers.
There are $15$ Fibonacci numbers less than $1000$,
hence the answer $1000 - 15 = 985$.