  In this article we relate two different densities. Let $F_k$ be the free
group of finite rank $k \ge 2$ and let $\alpha$ be the abelianization map from
$F_k$ onto $ \mathbb{Z}^k$. We prove that if $S \subseteq \mathbb{Z}^k$ is
invariant under the natural action of $SL(k, \mathbb{Z})$ then the asymptotic
density of $S$ in $\mathbb Z^k$ and the annular density of its full preimage
$\alpha^{-1}(S)$ in $F_k$ are equal. This implies, in particular, that for
every integer $t\ge 1$, the annular density of the set of elements in $F_k$
that map to $t$-th powers of primitive elements in $\mathbb{Z}^k$ is equal to
to $\frac{1}{t^k\zeta(k)}$, where $\zeta$ is the Riemann zeta-function. An
element $g$ of a group $G$ is called a \emph{test element} if every
endomorphism of $G$ which fixes $g$ is an automorphism of $G$. As an
application of the result above we prove that the annular density of the set of
all test elements in the free group $F(a,b)$ of rank two is
$1-\frac{6}{\pi^2}$. Equivalently, this shows that the union of all proper
retracts in $F(a,b)$ has annular density $\frac{6}{\pi^2}$. Thus being a test
element in $F(a,b)$ is an ``intermediate property'' in the sense that the
probability of being a test element is strictly between 0 and 1.
