\[\sum(-1)^{k}p\left(\mathcal{D},n-(3k^{2}\pm k)\right)=\begin{cases}1,&n=\tfrac%
{1}{2}(r^{2}\pm r),\\
0,&\mbox{otherwise},\end{cases}\]