$\newcommand{\N}{\mathbb{N}}$ Let $n \in \N$, we define $[n] \doteq \{1 , \ldots, n \}$. Consider the following $$ H_n^k \doteq \{ z \in [n]^k \mid \forall i \in [k-1]: \ z_{i+1} \neq z_i + 1 \} $$
Where, $z_i$ is the value at the position $i$. In other words, we are considering the sequences of length $k$ with elements in $[n]$, such that for every position the next one is not the succesor. For example the sequence $z = 13476 \notin H_7^5$.
How to calculate $\left | H_{n}^k \right |$ ?
Let me show you my attempt. Let's define $$ F_{n}^{i} = \{ z \in [n]^k \mid z_{i+1} = z_i + 1 \} $$ then, what we are looking for is $$n^k - \left | \bigcup\limits_{i=1}^{k-1} F_n^i \right | $$Afterwards, what I wanted to use is the inclusion-exclusion principle but I got in troubles when I try to calculate the cardinal of the intersection of any of them.
Any suggests?
Regards!