Suppose that $m$ is a positive integer. I want all the possible ways to write $$ m=k_1+\ldots+k_{2m} $$ where $k_i \in [-2,2] \cap \mathbb Z$.
For example, if $m=1$, I can write $$ 1=1+0 \quad \text{or}\quad 1=2+(-1). $$ Already at the step $m=2$, the number of ways increases quickly, so I am looking for a general way to solve this problem.
Edit. I am interested in the decomposition, not just counting. Moreover, the decomposition has to be invariant by the action of the symmetric group $S_{2m}$, that is the decomposition $m=k_1+\ldots+k_{2m}$ is the same of $$ m=k_{\sigma(1)}+\ldots+k_{\sigma(2m)} $$ for every permutation $\sigma \in S_{2m}$.
Edit 2. The problem is equivalent to find five non-negative integers $a,b,c,d,e \in \mathbb Z_{\ge 0}$ such that it holds $$\tag{$\star$} \begin{cases} -2a-b+d+2e=m \\ a+b+c+d+e=2m \end{cases}. $$ At this point, I am also interested in the non-negative integer solutions of the system $$\tag{$\star\star$} \begin{cases} -2a-b+d+2e=3m \\ a+b+c+d+e=2m \end{cases}. $$
Letting $a$ be the number of copies of $-2$, letting $b$ be the number of copies of $-1$, and so on up to $e$ being the number of $(+2)$'s, then you want to produce all solutions to the following system of equations over the nonnegative integers: $$ \begin{align} a+b+c+d+e&=2m\\ -2a-b+d+2e&=t,\\ a,b,c,d,e&\in \mathbb N \end{align} $$ where $t$ is either $m$ or $3m$.
By adding three copies of the first equation to the second, we get an equivalent system of equations where all coefficients are positive. $$ \begin{align} a+b+c+d+e&=2m\\ a+2b+3c+4d+5e&=6m+t,\\ a,b,c,d,e&\in \mathbb N \end{align} $$ It is easy to do produce all solutions to such a system recursively. Namely, suppose we have already determined that $e_0$ is the value for $e$ in a particular solution. Then the remaining variables are solutions to the following simpler system: $$ \begin{align} a+b+c+d&=2m-e_0\\ a+2b+3c+4d&=6m+t-5e_0,\\ a,b,c,d&\in \mathbb N \end{align} $$ Therefore, we just need to loop through all possible values of $e$, then recursively return all solution for this simpler system for each. The lower limit for $e$ is $0$, and the highest possible value for $e$ is $\min(2m,\lfloor (6m+t)/5\rfloor)$, because the right-hand-side of both equations must be nonnegative.
Here is a Python implementation. Since this is a math site, I should really be language agnostic and just give you the algorithm in pseudocode, but Python is pretty close to pseudocode anyway. ¯\_(ツ)_/¯
Try it online!