1
$\begingroup$

Source

How many permutations $\left(a_1,a_2,\dots,a_n \right)$ of $\left(1,2,\dots,n \right)$ such that $$\left|a_{i+1} - a_i \right| \le 2, \ \forall i=1,2,\dots,n-1.$$ At first I thought this might be an induction problem, but the best idea I have had so far is to look at it through recurrent relations. Let the number of valid permutations for $n$ where the last element is $a_n$ be $P_n$. We then know $P_n = P_{n-1} + P_{n-2} + 1$. This can be solved to get $P_n = c_1 F_n + c_2 L_n - 1$ (where $c_1$ and $c_2$ are arbitrary parameters and $F_n$ is the n-th Fibonnaci number and $L_n$ is the n-th Lucas number). However, I am not sure how to solve the other cases with induction or reccurence.

The only answer in the source is that it's a famous problem, but I have not been able to find any other problems that are similiar to it. Any help is appreciated, thanks!

$\endgroup$
2
  • $\begingroup$ Perhaps an easier version of the problem or a simplification would be if we assume that $a_1 = 1$, maybe solving for this could lead us in the right direction? $\endgroup$ Commented Oct 1, 2023 at 8:28
  • 1
    $\begingroup$ I don't want to spoil the problem completely so I'll just sketch minimally. Inductively, you can inject $n+1$ into the sequence in a few different scenarios (or equivalently, delete $n$). You need to keep track of where $n, n-1$ (and in some configurations $n-2$) are and where the new sequence with $n+1, n, n-1$ now lands. Solve that system of recurrence (it isn't that nice but possibly doable in competition settings? Not sure.). See also OEIS A003274. $\endgroup$ Commented Oct 1, 2023 at 9:26

0

You must log in to answer this question.

Browse other questions tagged .