Let $L=[a,b]\cap\mathbb{N}$ with $a,b\in\mathbb{N}$, let $D\in\mathbb{N}$, and let $C=L^D$. Then I would like to know how many points are there in $C$ with the same given norm-2 $d$. I.e., I'm looking for $|A|$, where


$A = \{p\in C,\ ||p||\_2=d\}$



How many points are in such set with the same norm-2
The answer is the coefficient of $t^{d^2}$ in the generating function
$\left( \sum\_{j=a}^b t^{j^2}\right)^D$. 


