About the problem: you probably know about
Gauss circle problem. I'm trying to tackle a generalized version where the center of the circle is arbitrary, so it can be optimized to cover the maximum or minimum number of points for a given radius, and the number of dimensions N can be more than 2 (so a ball instead of a circle).