# When is a centerless group characteristic in direct product with $\mathbb{Z}^n$?

Consider an abelian group $A$ and a centerless group $B$. We can construct the direct product $A \times B$ of these groups, and $Z(A \times B) = Z(A) \times Z(B) = A \times 1 \cong A$. Now, the center of a group is always characteristic, but the second factor need not be (see Characteristic subgroups of a direct product of groups for an example).

In the case that $A = \mathbb{Z}^n$, and $B$ is an infinite centerless group, is $B \cong 1 \times B$ always characteristic in $A \times B$ ? And if not, can you impose any conditions on $B$ such that it is?

(If it helps, you may assume that $B$ is finitely generated and polycyclic, as these are the groups I'm interested in)

As soon as there is a non-trivial homomorphism from $B$ to $A$, then $1\times B$ is not a characteristic subgroup. Indeed, if $f:B\to A$ is such a morphism, then $$F:\mathbb{Z}^n\times B \to \mathbb{Z}^n\times B: (z,b)\mapsto (z+f(b),b)$$ is an automorphism of $\mathbb{Z}^n\times B$ which does not preserve $1\times B$. If, for instance, $B=F_n$ is the free group in $n>1$ letters, then the natural surjection $f:F_n\to \mathbb{Z}^n$ yields an example where $1\times B$ is not a characteristic subgroup, and $B$ is infinite and centerless.
This does not, however, answer the question in the case where $B$ is finitely generated and polycyclic.
Edit: The above is, in fact, a necessary and sufficient condition for $1\times B$ to be a characteristic subgroup. The statement would be:
Assume that $A$ is abelian. Then $1\times B$ is a characteristic subgroup of $A\times B$ if and only if there are no non-trivial morphisms from $B$ to $A$.
One implication was proved above. For the other, assume that $1\times B$ is not a characteristic subgroup of $A\times B$, and let $\phi$ be an automorphism of the latter which does not preserve the former. Then the composition $$B\stackrel{i_2}{\to} A\times B \stackrel{\phi}{\to} A\times B \stackrel{\pi_1}{\to} A$$ is a non-trivial morphism from $B$ to $A$.