In order for a perfect binary code on $n$ symbols to correct $k$ errors, we need the sum
$${n\choose 0}+{n\choose 1}+\ldots+{n\choose k}$$
to be a power of two, since the number of codewords is $2^n$ divided by that sum. If one looks in Pascal's triangle for such sums, one finds:
- $k=n$, corresponding to a code with a single keyword (trivial)
- $k=0$, corresponding to a code with all $2^n$ codewords that corrects no errors (trivial)
- $k=\lfloor \frac n2\rfloor$ when $n$ is odd, corresponding to two codewords (trivial)
- $n=2^m-1, k=1$, corresponding to a Hamming code
- $n=23, k=3$, corresponding to the perfect Golay code.
All of the above correspond to real error-correcting codes, and in fact the above is a complete list of perfect binary codes (see e.g. the assertion in section 2 here). But there are numerical coincidences in Pascal's triangle that don't lead to a perfect binary code, such as the fact that
$${90\choose 0}+{90\choose 1}+{90\choose 2} = 4096 = 2^{12}$$
I'm curious whether there are any other such numerical coincidences in Pascal's triangle. It seems that there aren't - I've checked the first 1,000,000 rows - but I don't know how I'd prove this.
Here are some comments and ideas, a proof for $k=3$, and no new solutions. Beware of misprints and mistakes.
First. let us define the polynomial $F_k(x)$ by $$ \frac{F_k(x)}{k!}=\binom{x}{0}+\cdots+\binom{x}{k} $$ which has degree $k$, and integer coefficients with leading coefficient 1. In particular, $F_0(x)=1$, $F_1(x)=x+1$, $F_2(x)=x^2+x+2$, and so on.
The question then becomes finding $n,k,m$ for which $F_k(n)=k!\cdot 2^m$.
Cases $k=0,1$ have already been addressed, so I'll skip those. I'll also skip cases with $n\le k$ which solve for $m=n$. So what remains is $n>k\ge2$.
We may also note that for $k$ odd, $F_k(x)$ will always be a multiple of $x+1$ since we can write $$ \frac{F_k(x)}{k!} =\binom{x}{0}+\cdots+\binom{x}{k} =\binom{x+1}{1}+\binom{x+1}{3}+\cdots+\binom{x+1}{k} $$ where all binomials on the right have $x+1$ as a factor.
Note that I'll use $x$ instead of $n$ when treating $F_k(x)$ as a polynomial in $x$ rather than then integer value $F_k(n)$ for some particular integer $n$. So when I write that $x+1$ is a factor of $F_k(x)$ for odd $k$, this is as polynomials.
Case $k=3$:
I'll do this first since it is the easier case. Adding up the binomial terms, we get $F_3(x)=x^3+5x+6=(x+1)(x^2-x+6)$. We wish to find all $n,m$ for which $F_3(n)=3!\cdot 2^m=3\cdot 2^{m+1}$. This results in two alternatives: $$ \text{a)}\quad x+1=2^p\quad\text{and}\quad x^2-x+6=3\cdot2^q,\\ \text{b)}\quad x+1=3\cdot 2^p\quad\text{and}\quad x^2-x+6=2^q\\ $$ where $p,q$ are both non-negative integers, $p+q=m+1$. Plugging $x=2^p-1$ or $x=3\cdot2^p-1$ into $x^2-x+6$ on the right hand side, we see that it suffices to check for small $p,q$. Eg, if $x=2^p-1$, we get $x^2-x+6=2^{2p}-3\cdot2^p+8=3\cdot2^q$, so we cannot have both $p,q>3$.
Checking for small values of $p,q$, the only solutions with $n>k=3$ are $(n,m)=(7,6),(23,11)$.
Odd $k$
For odd $k$, we can factor $F_k(x)=(x+1)\cdot G_k(x)$. Solving $F_k(n)=k!\cdot2^m$ means we can write $n+1=a\cdot2^p$, $G_k(n)=b\cdot2^q$ where $k=a\cdot b\cdot 2^r$ with odd $a,b$ and $p+q=r+m$. This results in more cases than for $k=3$, but for each $k$ I suspect it should still be a finite problem.
Case $k=2$:
For $k=2$ we want to solve $F_2(n)=n^2+n+2=2^{m+1}$.
Rewrite this as $(2n+1)^2=4n^2+4n+1=2^{m+3}-7$. Looking at this modulo powers of 2 reduces the options for $n$, but it seems $-7$ remains a square for all powers.
If $m=2r-1$ is odd, we can factor $2^{2r}-(2n+1)^2=7$, into $(2^r+2n+1)(2^r-2n-1)=7\cdot 1$, which gives us $(n,m)=(1,1)$ as the only solution, which has already been addressed as $n\le k$.
So we must have $m$ even.
Alternative approach
This was what I tried first, which might interest some.
For $k=2$ we have $F_2(x)=x^2+x+2$. This does not factor like for odd $k$.
However, if we introduce $\omega=(1+\sqrt{7}i)/2$, we can factor it $F_2(x)=(x+\omega)(x+\bar\omega)=(x+\omega)(x+1-\omega)$ where the complex conjugate $\bar\omega=1-\omega$.
The ring $\mathbb{Z}[\omega]$ of numbers $u+v\omega$ is a principle ideal domain, hence has unique factorization. The number 2 factors $2=\omega\bar\omega=\omega(1-\omega)$, so the equation becomes $$ F_2(n)=(n+\omega)(n+1-\omega)=2^m=\omega^m(1-\omega)^m $$ which means we are looking for powers $\omega^m=\pm(s+\omega)$ where $s$ is either $n$ or $-(n+1)$.
A search for $m$ up to $100000$ yielded $(n,m)=(5,4),(90,12)$. Not sure if this approach can be used to obtain a full solution.