Given an alfabet of $n$ letters. A sequence of letters such that between any 2 identical letters there are no 2 identical letters is called a [i]word[/i].

a) Find the maximal possible length of a [i]word[/i].

b) Find the number of the [i]words[/i] of maximal length.
### Part (a)
1. **Understanding the Problem**: We need to find the maximal possible length of a sequence of letters (a *word*) such that between any two identical letters, there are no two identical letters.

2. **Initial Observations**: 
   - If we have a letter \(a\), and it appears three times in the sequence, the sequence must be structured such that the first and third occurrences of \(a\) do not enclose another pair of identical letters.
   - This implies that the sequence can be structured as \(a \ldots a \ldots a\), where the dots represent other letters, ensuring no two identical letters are enclosed by the same letter.

3. **Constructing the Sequence**:
   - Consider the sequence \(111222 \ldots nnn\). Here, each letter appears exactly three times, and the condition is satisfied.
   - For any letter \(i\), the sequence \(i \ldots i \ldots i\) does not enclose another pair of identical letters.

4. **Maximal Length Calculation**:
   - Since each of the \(n\) letters appears exactly three times, the maximal length of the sequence is \(3n\).

Thus, the maximal possible length of a *word* is \(3n\).

### Part (b)
1. **Counting the Number of Words**:
   - We need to count the number of distinct sequences of maximal length \(3n\) that satisfy the given condition.

2. **Permutations of Letters**:
   - We can permute the \(n\) letters in any order. There are \(n!\) ways to permute \(n\) letters.

3. **Structure of the Sequence**:
   - Given a specific permutation of the letters, we need to determine the number of valid sequences.
   - For a fixed permutation, consider the sequence starting with \(111\). The next letter must be \(22\) to avoid enclosing another pair of identical letters. This pattern continues.

4. **Inductive Hypothesis**:
   - Let \(f(n)\) be the number of valid sequences for \(n\) letters.
   - We calculate \(f(1) = 1\), \(f(2) = 2\), and \(f(3) = 4\) by hand.
   - We conjecture that \(f(n) = 2^{n-1}\).

5. **Inductive Proof**:
   - Assume \(f(n-1) = 2^{n-2}\).
   - For \(n\) letters, remove the three \(1\)'s. The remaining sequence is a valid sequence of length \(3(n-1)\), which must start with \(22\).
   - The original sequence can start with \(11122\) or \(112122\), ensuring the condition is met.
   - Thus, the number of valid sequences for \(n\) letters is \(2 \times f(n-1) = 2 \times 2^{n-2} = 2^{n-1}\).

6. **Total Number of Words**:
   - Considering all permutations of the \(n\) letters, the total number of words is \(n! \times 2^{n-1}\).

The final answer is \( \boxed{ 3n } \) for part (a) and \(n! \times 2^{n-1}\) for part (b).