Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I encountered the sequence A000255. $a(n)$ counts permutations of $[1,...,n+1]$ having no substring $[k,k+1]$

I am finding difficulty in proving it. Can you please give any clues or hints on how to attack the problem?

share|cite|improve this question
up vote 2 down vote accepted

The recurrence is $a(n)=na(n-1)+(n-1)a(n-2)$ The first term is the number of ways to insert $n+1$ into a proper permutation of $[1,\ldots,n]$-you can put it anywhere except after $n$. The second counts the ways to have a permutation of $[1,\ldots,n]$ with exactly one pair $[k,k+1]$, which you then break up by putting $n+1$ between them. You choose which number will be $k$ (to be followed by $k+1$), but it can't be $n$. Then link $k$ and $k+1$ as a pair and make a proper permutation (of $n-1$ items).

share|cite|improve this answer
thanks , wonderful solution – Learner Aug 4 '12 at 1:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.