Find $n$ such that ${n \choose 0}+{n \choose 1}+{n \choose 2}+{n \choose 3}$ is a factor of $2^{2018}$ Find all $n$ such that ${n \choose 0}+{n \choose 1}+{n \choose 2}+{n \choose 3}$ is a factor of $2^{2018}$.
I got this interesting question from a friend. I made an assumption and was able to get $n$ as $3$ and $7$ but am not able to get more solutions.
Any help to solve this question would be appreciated. Thanks in advance.

Let
$$u(n)={n \choose 0}+{n \choose 1}+{n \choose 2}+{n \choose 3}=\frac{(n+1)(n^2-n+6)}6$$
First, we must have $n\ge0$, otherwise the left hand side is zero.
If $u(n)$ is a factor of $2^{2018}$, that means $u(n)$ must be a power of two. Since $3$ must divide either $n+1$ or $n^2-n+6$, this means that either:
$$\begin{eqnarray}
n+1&=&3\cdot 2^p\\
n^2-n+6&=&2^q
\end{eqnarray}
$$
or
$$\begin{eqnarray}
n+1&=&2^p\\
n^2-n+6&=&3\cdot2^q
\end{eqnarray}
$$

In the first case, since $n^2-n+6>\dfrac{n+1}{3}$, we must have $2^p|2^q$, but
$$n^2-n+6=(n-2)(n+1)+8=3(n-2)\frac{n+1}{3}+8$$
Hence $\frac{n+1}{3}$ divides $8$. The possible values of $n$ are then $\{2,5,11,23\}$, and it's easy to check that only $2$ and $23$ are valid solutions.

In the second case, we have either $2^p|2^q$ or $2^q|2^p$ (or both).
If $2^p|2^q$, then $n^2-n+6=(n-2)(n+1)+8$, hence $n+1$ divides $8$, and the possible values of $n$ are $\{0,1,3,7\}$, which are all valid solutions.
If $2^q|2^p$, then $\frac{3(n+1)}{n^2-n+6}$ is an integer, but it's $\ge1$ for only finitely many values of $n$, namely for $n\le3$, but we already have all values of $n\le3$ as valid solutions (but it's easy to check that $\frac{3(n+1)}{n^2-n+6}$ is an integer only for $n\in\{1,3\}$).

All in all, the set of solutions is
$$n\in\{0,1,2,3,7,23\}$$
