# Automorphism group of $\mathbb Z_p\times \mathbb Z_{p^2}$

I'm trying to determine the order of the automorphism group of $\mathbb Z_p\times \mathbb Z_{p^2}$ for $p$ prime.

What I've done: Let $(1,0)\mapsto (x,y_0)$ and $(0,1)\mapsto(z,t)$. For this map to be a homomorphism, we must have $(p,0)\mapsto (0,0)$ and $(0,p^2)\mapsto (0,0)$, so $y_0$ must be divisible by $p$; write $y_0=py$. So any homomorphism is given by $(0,1)\mapsto (x,py)$ and $(0,1)\mapsto (z,t)$ with $0\le x,y,z \le p-1,\ 0\le t\le p^2-1$. (By the way, is this argument of determining whether a map from $\mathbb Z_p\times \mathbb Z_{p^2}$ to itself a group homomorphism complete?)

Now an automorphism is an invertible homomorphism. Clearly, if $t$ is divisible by $p$, then the image consists of elements of the form $(r,2s)$ and thus the homomorphism is not surjective. So $p$ must not divide $t$. Also, I have the hypothesis that $p$ must not divide $x$, but I don't see why this should be the case in general.

I tried to prove that $p \nmid x$ by converse (this worked in the case $p \nmid t)$: we have $(1,0)\mapsto (px,py),\ (0,1)\mapsto (z,t)$, so $(r,s)\mapsto (rpx+sz, rpy+st)$, but what's bad about this?

Also, I don't know whether the above two conditions are sufficient for the corresponding map to be invertible, and if so, I have no idea how one proves this.

The following theorem might be useful: from [1] we know that if two finite groups $G$ and $H$ have no common direct factor, then the automorphism group of their direct product can be expressed as $$\left\{ \begin{pmatrix} \alpha & \beta \\ \gamma & \delta \end{pmatrix} : \alpha \in \operatorname{Aut}(H), \; \delta \in \operatorname{Aut}(K), \; \beta \in \operatorname{Hom}(K,Z(H)) ,\; \gamma \in \operatorname{Hom}(H,Z(K)) \right\}$$
where we view the direct product as $\left\{ \begin{pmatrix} g \\ h \end{pmatrix}, g \in G , \; h \in H \right\}$.
In particular, since your groups are abelian, the order is $|\operatorname{Aut}(H)||\operatorname{Aut}(K)||\operatorname{Hom}(K,H)||\operatorname{Hom}(H,K)|$.