How to prove a duality about partitions of numbers? I found the following theorem, which I think should be correct but I do not know how to prove it:
Consider the set containing sums $A=\lbrace\sum\limits_{i=-a}^a iX_i\rbrace$ where $X_i$ is a non-negative integer and the positive integer $a$ increases by 2 each time(so there are $a+1$ terms in the sum), up to the constraint that $\sum\limits_{i=-a}^a X_i=b$, where $b$ is another positive integer. Now consider another set $B=\lbrace\sum\limits_{i=-b}^b iY_i\rbrace$ up to the constraint $\sum\limits_{i=-b}^b Y_i=a$, where the same $a, b$ are used and $Y_i$ is also a non-negative integer as $X_i$. The theorem is $A=B$ for all $a,b$. 
My strategy is to prove it by induction. It is obvious that they have the same finite cardinality. I need to construct a map which is bijective between $A,B$, but I do not how. Can someone help?
 A: If we index the $X_i$ with $i=0,1,\dots,a$ then the sum can be written:
$$\sum_{i=0}^a (2i-a) X_i = 2\sum_{0}^a iX_i - a\sum_0^a X_i = 2\left(\sum_{0}^a iX_i\right) - ab$$ So we really only need to know that 
$$A_0:=\left\{\sum_{i=0}^a iX_i\mid \sum_0^a X_i = b, X_i\geq 0\right\} = \left\{\sum_{i=0}^h iY_i\mid \sum_0^b Y_i = a, Y_i\geq 0\right\}=:B_0$$
That seems to be easier to deal with than the complicated "every other" sum question.
We can easily show that $N\in A_0$ if and only if $N$ can be written as a partition of $b$ non-negative integers no bigger than $a$.
But if we have such an $N=\sum iX_i$, then we can represent that partition by placing $N$ tokens on an $a\times b$ checker board so that $X_i$ columns each have exactly $i$ checkers in the column. Then rotate the board and count $Y_i$ as the number of rows that have exactly $i$ checkers in the row, showing $N\in B_0$.  
Clearly, the problem is symmetric, so $A_0=B_0$ and your $A=B$.
For example, if $a=5, b=6$, then and we have $(X_0,\dots,X_5)=(1,0,1,3,0,2)$. Then $\sum iX_i = 1\cdot 2+2\cdot 3+2\cdot 5 = 18$. This then gets represented as:
$$\begin{pmatrix}X&X&X&X&X&-\\
X&X&X&X&X&-\\
X&X&X&X&-&-\\
X&X&-&-&-&-\\
X&X&-&-&-&-
\end{pmatrix}$$
Then $Y_2=2$ since there rae two rows with $2$ checkers, $Y_4=1$, since there is one row with $4$ checkers, and $Y_5=2$. So $2\cdot 2 + 4\cdot 1 + 2\cdot5=18$.
This also shows that $A_0=\{0,1,2,\dots,ab\}$, because we can just put $N$ checkers on the board and then read off the result to get the $X_i$. That means $A=\{2k-ab\mid k=0,\dots ab\}$.
