4

Find number of ways to arrange $1$ to $n$ in a line so that no two consecutive numbers are adjacent.

I know this is https://oeis.org/A002464 !!

I tried it with inclusion exclusion and got the number of ways as

$n!-\sum_{k=1}^{n-1}$$\left((-1)^k(n-k)!\sum_{r=1}^{k}2^r\binom{n-k}{r}\binom{k-1}{r-1}\right)$

I also tried it with generating function my approach is almost same as this

Flajolet and Sedgewick generating function for Hertzsprung Problem

I want to know how to establish following recurrence:

Let $a_n$ be the required number of ways. Then

$a_n=(n+1)a_{n-1}-(n-2)a_{n-2}-(n-5)a_{n-3}+(n-3)a_{n-4}\forall n\ge 4;a_0=1,a_1=1,a_2=0,a_3=0.$

Same problem here: Special permutations of $\{1,2,3,\ldots,n\}$

Similar problems but simpler than the current one:

How many permutations of $\{1,2,3,...,n\}$ there are with no 2 consecutive numbers?

Number of permutations $\langle a_1,\ldots,a_n\rangle$ of $\{ 1,\ldots ,n \}$ with $a_{i+1} - a_i \ne 1$

Show number of permutations on $[n]$ where $i$ is not followed by $i+1$ is $D_n + D_{n-1}$

xskxzr
  • 858
Makar
  • 2,449
  • Interesting question. It's surprising how tricky the recurrence seems to be to work out from scratch. There's a link to a paper that shows how to get the recurrence on the OEIS page for that sequence. It's not the full story, but maybe a useful starting point: https://projecteuclid.org/journals/annals-of-mathematical-statistics/volume-36/issue-2/A-Recurrence-for-Permutations-without-Rising-or-Falling-Successions/10.1214/aoms/1177700181.full – Chris Lewis May 17 '24 at 13:03

0 Answers0