Can we count the number of integer lattice points in this case? Gauss Circle problem gives the number of lattice points lie within a circle of radius $r$. This question points to a reference that estimates the number of lattice points in a $d−$dimensional ball.
$2rd$ represents the number of integer lattice points that have distances only on one coordinate(dimension) like, for example, $(1,0,\dots,0)$ or $(0,r,0\dots,0)$.
Suppose that we have a $d−$dimensional ball around the origin, we want to count the number of integer lattice points that lie within a distance $r$ from the origin where these points should have distances only in no more than $(d/2)$ coordinates and it's distance on the rest of coordinates must equal $0$. i.e if $d=4$ and $r=3$ then what is the number of integer lattice points lie within the ball s.t these points lie in a number of coordinates $≤2$.
Up to the written constraint, we can count the following points $(1,0,0,0),(0,−3,0,0),(0,1,−2,0),(−1,0,0,−2),…$ But I can't consider $(−1,1,0,1)$
For sure I was able to consider $(−1,0,0,−2)$ because this point has distance in only two coordinates and the Euclidean distance to the origin $(0,0,0,0)$ is $5 <(r^2=9)$ where as the point $(−1,1,0,1)$ was not considered because it has distance in three dimensions (against our constraint) although it's distance to the origin $=3<r^2=9$.
Is it possible to enumerate this number? If so, is there a known formula or procedure to compute or bound this number of lattice points? Also, is there a relation between this constrained number and the whole number of lattice points (for example, if $n$ is the constrained number and $N$ is the whole number of integer lattice points then $N>n\geq N/2$).
I asked this question previously here but I didn't receive an answer! 
Thanks for any help, hint or a reference.
 A: Given any subset $S$ of $\{1,\dots,d\}$, let $L_S(r)$ be the set of lattice points within distance $r$ of the origin with the property that their $j$th coordinates, for all $j\notin S$, equal $0$. For example, $(0,1,0,2)$ is an element of both $L_{\{2,4\}}(7)$ and $L_{\{1,2,4\}}(\sqrt5)$ but not an element of either $L_{\{2\}}(7)$ or $L_{\{2,4\}}(2)$.
You are wanting to count the number of elements of
$$
\bigcup_{\substack{S\subseteq\{1,\dots,d\} \\ \#S\le d/2}} L_S(r);
$$
and of course the reason that the answer is not simply
$$
\sum_{\substack{S\subseteq\{1,\dots,d\} \\ \#S\le d/2}} \#L_S(r)
$$
is because many lattice points are double-counted or worse.
However, this is precisely the type of situation that inclusion–exclusion was designed to solve. The exact number of lattice points you are trying to count is
$$
\sum_{\substack{S\subseteq\{1,\dots,d\} \\ \#S\le d/2}} (-1)^{\lfloor d/2\rfloor - \#S} \#L_S(r).
$$
Moreover, if $B_{k}(r)$ counts the number of lattice points in a $k$-dimensional ball of radius $r$, then
$$
\sum_{\substack{S\subseteq\{1,\dots,d\} \\ \#S\le d/2}} (-1)^{\lfloor d/2\rfloor - \#S} \#L_S(r) = \sum_{k=0}^{\lfloor d/2\rfloor} (-1)^{\lfloor d/2\rfloor - k} \binom dk B_{k}(r).
$$
For large $r$ this will be approximately $\binom d{\lfloor d/2\rfloor} B_{{\lfloor d/2\rfloor}}(r) \approx \binom d{\lfloor d/2\rfloor} c_{\lfloor d/2\rfloor}r^{{\lfloor d/2\rfloor}}$, where $c_m = \pi^{m/2}/\Gamma(m/2+1)$. But the point is that there is an exact formula that you can extract whatever information you want from.
