I ran into a problem in evaluating a sum over kronecker delta. I want to evaluate
$$\sum_{\ell_1,...,\ell_{2m}=1}^s\delta_{\ell_1+\ell_3+...+\ell_{2m-1},\ell_2+\ell_4+...+\ell_{2m}}$$
My approach was to change indices to the sum in the delta, i.e $\ell=\ell_1+\ell_3+...+\ell_{2m-1}$ and $\ell'=\ell_2+\ell_4+...+\ell_{2m}$, but then I need to know how many times each $\ell$ occurs as such a sum, i.e. I need to know $p_k(n;s)$, which I define as the number of partitions of $\ell$ into $m$ parts with the largest element at most $s$. Then the sum becomes
$$\sum_{\ell_1,...,\ell_{2m}=1}^s\delta_{\ell_1+\ell_3+...+\ell_{2m-1},\ell_2+\ell_4+...+\ell_{2m}}=\sum_{\ell=m}^{ms}p_m(\ell;s)$$
I need to include all permutations of the partition, for instance for $m=2$ I want
$$p_2(\ell;s)=\left\{\begin{array}{cc}\ell-1&\ell\leq s+1\\2s+1-\ell&\ell>s+1\end{array}\right.$$
which comes from the following partitions for $s=6$: $$ 5=1+4=2+3=3+2=4+1\\ 6=1+5=2+4=3+3=4+1=5+1\\ 7=1+6=2+5=3+4=4+3=5+2=6+1\\ 8=2+6=3+5=4+4=5+3=6+2\\ 9=3+6=4+5=5+4=6+3$$
Then for $m=3$ the following partitions are needed for $s=3$ (smaller $s$ for simplicity)
$$ 3=1+1+1\\ 4=1+1+2=1+2+1=2+1+1\\ 5=1+1+3=1+3+1=3+1+1=1+2+2=2+1+2=2+2+1\\ 6=1+2+3=3+1+2=2+3+1=3+2+1=1+3+2=2+1+3=2+2+2\\ 7=2+2+3=2+3+2=3+2+2=1+3+3=3+1+3=3+3+1\\ 8=2+3+3=3+2+3=3+3+2 $$
But I don't see the functional dependence yet. In general, $p_k(n;s)$ is definetely non-trivial. Does anyone have any tips how to evaluate this function? At least for n<=5 for starters?
PS. I have a way to evaluate the leading term of the sum, by changing the kronecker delta to dirac delta, then chaning variables and integrating integrals of the same kind as listed here Integration of Dirac delta over finite interval , but I want all terms if possible to said sum.
Thanks for any help!