I want to find the set of integers $n$ for which the repition code of length $n$ is perfect for the alphabet $\{0,1\}$.
The repition code is the code where each letter is repeated $m$-times, the minimum distance is $m$, it is $m-1$ error detecting and $\lfloor 1/2(m-1)\rfloor$-error correcting.
A code is perfect when there is equality in the the Hamming's bound $K\le \frac{2^N}{V(N,e+1)}$ where $c:A\rightarrow\{0,1\}^N$ is an $e$-error correcting code and $K=|A|$ is the number of cde words and $V(N,e+1)=\binom N 0+...+\binom N {e}$.
How can I find the set of integers where the repition code is perfect? Is $N=n$ in our case?
Hint #1: A $t$-error correcting code $C$ is perfect, if and only if to each received vector $\mathbf{y}$ there is a unique codeword $\mathbf{x}\in C$ such that $d_H(\mathbf{y},\mathbf{x})\le t.$ This is because the existence of such an $\mathbf{x}$ to all $\mathbf{y}$ means that balls of radii $t$ centered at the codewords cover the entire Hamming space. Uniqueness of $\mathbf{x}$ means that those balls cover the Hamming space without overlap, i.e. the code is perfect.
Note: Uniqueness actually follows from the assumption that the code is $t$-error correcting. The covering part is non-trivial.
Hint #2: For which values of $n$ does majority voting among individual bits guarantee the existence of the required word $\mathbf{x}$ of the repetition code, no matter what the received vector $\mathbf{y}$ is?
Moral: Sometimes there are alternatives to counting.