An alternative route uses the scalar potential. Any irrotational field can be written as \(\mathbf{F}=-\nabla\phi\) for some potential \(\phi(r)\). Matching \(-d\phi/dr = ar^n\) for the purely radial field gives \(\phi(r) = -\dfrac{ar^{n+1}}{n+1}\) (for \(n\neq -1\)) - a valid scalar potential exists for every such \(n\), confirming \(\mathbf{F}\) is a gradient (hence irrotational) field for any \(n\), consistent with the direct curl argument.
Now impose the additional solenoidal requirement \(\nabla\cdot\mathbf{F}=0\), i.e. \(\nabla^2\phi=0\) (Laplace's equation) away from the source. Using the radial Laplacian and \(d\phi/dr=-ar^n\) reproduces the same condition as before:
\[\frac{d}{dr}\left(r^{n+2}\right)=0 \implies n=-2\]
This is the geophysically familiar potential of a point mass or charge, \(\phi\propto 1/r\), whose gradient field \(\propto r^{-2}\hat{r}\) is both irrotational (any gradient field is) and solenoidal away from the source - exactly the behaviour of the gravitational and Coulomb fields used throughout potential-field geophysics.
So \(n=-2\), matching option (B).