# How many middle peaked words of length 5 are there in an alphabet with n letters?

Using an alphabet of $$n$$ letters, how many middle peaked words of length 5 are there?

Let's define "middle peaked word" as a word with the middle letter dividing the word into two. To the left of this peak letter, the letters increase (are ordered alphabetically) and to the right of this peak letter, the letters decrease (are ordered reverse-alphabetically). For example: A < D < L > K > B.

I've been really struggling with this problem. I tried splitting into three, for example :

________ | _ | ________

With the left space being a word with "increasing" order. So how many ways can this word be chosen? This word would be of length 2 and chosen from an alphabet of $$n$$ letters, so the number of ways to choose this word is $$\binom{2+n-1}{2}$$. But I'm not sure where to go after this because the second word (of reverse alphabetical order) would have less options than $$n$$ since it needs to decrease from whatever is chosen as the peak.

If you choose letter $$k$$ for the middle letter, then you have $$\binom{k-1}{2}$$ choices each for the first two letters and the last two letters. So in total you have $$\sum_{k=1}^{n}\binom{k-1}{2}^2$$ possible words. If you want you can turn this into a closed form which will be a polynomial in $$n$$ of degree $$5$$, since $$\binom{k-1}{2}^2$$ is a degree $$4$$ polynomial in $$k$$.