Problem

Source: Czech And Slovak Mathematical Olympiad, Round III, Category A 2001 p4 / Croatia TST 2002 p1

Tags: combinatorics, max



In a certain language there are $n$ letters. A sequence of letters is a word, if there are no two equal letters between two other equal letters. Find the number of words of the maximum length.