10. (40 points) Given that $n$ is a positive integer, such that
$$
1+n+\frac{n(n-1)}{2}+\frac{n(n-1)(n-2)}{6}
$$
$=2^{k}$ ( $k$ is a positive integer).
Find the sum of all possible values of $n$.
10. Since
$$
\begin{array}{l}
1+n+\frac{n(n-1)}{2}+\frac{n(n-1)(n-2)}{6} \\
=\frac{(n+1)\left(n^{2}-n+6\right)}{6},
\end{array}
$$

Therefore, $n+1$ is a power of 2 or 3 times a power of 2.
(1) If $n+1=2^{m}\left(m \in \mathbf{N}_{+}\right)$, then
$$
n^{2}-n+6=2^{2 m}-3 \times 2^{m}+8
$$

is 3 times a power of 2.
When $m>3$, we have
$$
\begin{array}{l}
3 \times 2^{2 m-2}3$ when $m>3$, we have
$$
\begin{array}{l}
2^{2 m+3}=8 \times 2^{2 m}<9 \times 2^{2 m}-9 \times 2^{m} \\
<9 \times 2^{2 m}-9 \times 2^{2 m}+8<9 \times 2^{2 m}<2^{2 m+4} .
\end{array}
$$

Therefore, $n^{2}-n+6$ is not a power of 2.
Thus, $m \leqslant 3$. Hence, we only need to verify the cases $n=2, 5, 11$, and 23. After verification, $n=2$ and 23 satisfy the condition. Therefore, the sum of all possible values of $n$ is
$$
1+2+3+7+23=36 \text {. }
$$
(Xiong Bin provided)