\[\mathbf{\nabla} \cdot \mathbf{F} =r^n\]
in spherical polar coordinates, use the facet that fore a radial vector field \[F=F_r \mathbf{e_r}\]
, \[\mathbf{\nabla} \cdot \mathbf{F} = \frac{1}{r^2} \frac{\partial}{\partial r} (r^2 F_r ) =r^n\]
Hence
\[\frac{\partial}{\partial r} (r^2 F_r ) =r^{n+2}\]
Integrate both sides to get
\[r^2 F_r = \frac{r^{n+3}}{n+3}+A\]
Then
\[F_r = \frac{r^{n+1}}{n+3} + \frac{A}{r^2}\]
if \[n \neq 0\]
and \[F_r = \frac{r^{n+1}}{n+3} \]
if \[r=0\]
is possible, since \[\mathbf{\nabla} \cdot \mathbf{F}=0 \rightarrow F_r =\frac{1}{r^2}\]
using this result.