Why does the vector field $\mathbf{F} = \frac{\mathbf{r}}{r^n} $ represent a solenoidal vector field for only a single value of n? I'm currently studying Vector Calculus in undergrad, and I've got quite a few doubts that I couldn't eliminate when I tried looking them up. I've tried to organize them as best as I can, and would really appreciate any help to strengthen my understanding of the subject. 
While solving problems on solenoidal and irrotational vectors in class, this question popped up -
$\textit{Find the value of n for which}$ $\mathbf{F} = \frac{\mathbf{r}}{r^n}$ $\textit{is solenoidal.}$
For a vector field to be solenoidal, the divergence at all points in the field must be zero. Or, from a more visual perspective, the field lines either form closed loops, or according to Wikipedia, end at infinity.
This arrives at my first question; what does it mean for solenoidal field lines to end at infinity? I get how this kind of vector field wouldn't have any sinks, but how does this field correlate to having no sources at any point?
I analyzed the vector field $\mathbf{F}$ to be a field of position vectors, with the length of each vector at a point being scaled up or down by an exponent of the distance of the point from the origin, according to the value of n. However, for $\mathit{n}\neq$ 0, I noticed that at the origin, the numerator and the denominator become zero.
Is such an interpretation of the given field correct? If it is, how could the divergence of such a field be zero for any value of n? Isn't the net flux of field lines at any point in the field non-zero?
According to the vector operator identities, if $\mathit{f}$ is a scalar field and $\mathbf{F}$ a vector field, $$\nabla\cdot{f}{\mathbf{F}} = f\nabla\cdot{\mathbf{F}} + \mathbf{F}\cdot{\nabla}{f}$$ 
Applying this identity on $\mathbf{F}$ with $\mathbf{r}$ as the vector field and $r^{-n}$ being the scalar field, I solved the equation and arrived at $$\nabla\cdot\frac{\mathbf{r}}{r^n} = \frac{3 - n}{r^n}$$ Equating this to zero, I end up with $\mathit{n}$ = 3. This describes $\frac{\mathbf{r}}{r^3}$ as a solenoidal vector field. No other value of n yields such a field with $\mathbf{F}$.
I tried plotting the vector field $\mathbf{F}$ with $\mathit{n}$ as 3 and some other random values, but I wasn't able to observe any differences regarding the divergence-free property among any of them. How is the particular case of $\mathit{n}$ = 3 so special?
 A: I'll answer two of your questions:


*

*Why is the value $n=3$ unique in creating a solenoidal field?

*Why is this field solenoidal even though it seems like it shouldn't be?


To answer $1$, consider that because the field is radially symmetric, you should look at the field on a spherical volume element. 
Note that the element itself is not spherical, but is the volume element in a spherical coordinate system—such a volume element is kind of "fan-shaped", with the outwards face being larger than the inwards face. Physically, for there to be no divergence, the field can't "accumulate" within the element, and you'd need to find the field that causes the difference in the inwards/outwards face areas to be compensated by a drop in the field magnitude as you move outwards. In 3-D, the magic exponent is $3$.
Moving on to $2$, fields like this are tricky to identify as solenoidal because it seems like there's an obvious source at the origin. Indeed, a surface integral that contains the origin would demonstrate a nonzero value; but that's because the field isn't defined at the origin. If you take the definition of solenoidal to be "divergenceless everywhere that the field is defined", then this field is indeed solenoidal, because any closed surface integral in a region not enclosing the origin will have a divergence of $0$.
A: If ${\bf v}$ is a fluid field in some domain $\Omega\subset{\mathbb R}^3$ then at each point $P=(x,y,z)\in\Omega$ the divergence ${\rm div}\,{\bf v}(P)$ describes a purely local fact about ${\bf v}$. In particular it has nothing to do with the possible limit point of the field line of ${\bf v}$ through the point $P$.
Draw a small virtual sphere $\partial B_r$ around $P$, and compute the total flux of ${\bf v}$ out of this sphere. This flux will be tiny, because on one half of the sphere fluid will flow into $B_r$, and on the other half fluid will be flow out. Maybe there is a small difference. This difference comes from the fluid which is actually "produced" (or "deleted")  within $B_r$, and is proportional to ${\rm vol}(B_r)$. Therefore we will have
$$\int_{\partial B_r}{\bf v}\cdot{\bf n}\>{\rm d}\omega \ \approx \ c\>{\rm vol}(B_r)\qquad(0<r\ll1)$$
for a certain constant $c\in{\mathbb R}$. The value of this constant $c$ depends on ${\bf v}$ and on the chosen point $P$, and is called the divergence of ${\bf v}$ at $P$.
Given the dimension $3$ of ${\mathbb R}^3$ there is only one value of $n$ such that the resulting value of $c=0$. This has to do with the speeds by which the volumes and surfaces of large balls $B_R$ centered at the origin increase when $R\to\infty$.
