finding overlapping permutations I have a data set $3\; 4\; 5\; 6\; 7\; 8\; 9$
I want to find all the permutations that can be formed using this such that neither $7$ nor $8$ is adjacent to $9$.

We count the complement, the bad permutations where $7$ or $8$ is adjacent to $9$. 
How many permutations have $7$ adjacent to $9$? There are $6$ places for the pair to go, and they can be in either order, giving a total of $(6)(2)$ ways to place $7$ and $9$. The rest can be placed in $5!$ ways, for a total of $(6)(2)(5!)$.
Similarly, there are $(6)(2)(5!)$ bad permutations with $8$ adjacent to $9$.
If we add, we have double-counted the permutations where $7$ and $8$ are both adjacent to $9$. to count these, note that the $9$ can be put in $5$ places. For each of these, there are $2$ ways to place the $7$ and $8$, and $4!$ ways to place the rest. So the number of bad permutations is
$$(6)(2)(5!)+(6)(2)(5!)-(5)(2)(4!).$$
