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\}$
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\}$
The answer is the coefficient of $t^{d^2}$ in the generating function $\left( \sum_{j=a}^b t^{j^2}\right)^D$.