Calculate the number of elements of order 2 and order 4 in each of $\mathbb{Z}_{16}, \mathbb{Z}_{8}\bigoplus\mathbb{Z}_{2}$ etc. I'm trying to understand how to computer the order of an element in a finite abelian group in the form of $$\mathbb{Z}_{8}\bigoplus\mathbb{Z}_{2}$$ and I am just not getting it.  In particular I stumbled across this question:
Calculate the number of elements of order $2$ and order $4$ in each of: $\mathbb{Z}_{16}, \mathbb{Z}_{8}\bigoplus\mathbb{Z}_{2}, \mathbb{Z}_{4}\bigoplus\mathbb{Z}_{4}, \mathbb{Z}_{4}\bigoplus\mathbb{Z}_{2}\bigoplus\mathbb{Z}_{2}$
I even know the answer:
$\mathbb{Z}_{16}$ has 1 element of order 2 and 2 elements of order 4.
$\mathbb{Z}_{8}\bigoplus\mathbb{Z}_{2}$ has 3 elements of order 2 and 4 elements of order 4.
$\mathbb{Z}_{4}\bigoplus\mathbb{Z}_{4}$ has 3 elements of order 2 and 12 elements of order 4.
$\mathbb{Z}_{4}\bigoplus\mathbb{Z}_{2}\bigoplus\mathbb{Z}_{2}$ has 7 elements of order 2 and 8 elements of order 4.
Can someone please explain this in a simple way?  I've reread the appropriate sections in my textbook time and again and looked for explanations on the net without avail.
Thank you.
 A: It is know that if $d$ divides $n$ then $\mathbb Z_n$ has $\varphi(d)$ elements of order $d$.
We know that the order of $(g_1,g_2,\dots,g_r)$ in $G_1\oplus G_2 \oplus G_r$ is $lcm(|g_1|,|g_2|,\dots,|g_3|)$.
How many elements of $\mathbb Z_4 \oplus \mathbb Z_2 \oplus \mathbb Z_2$ have order $2$?
by the previous lemma all elements must have order $1$ or $2$. This gives us $2^3$ possibilities. We substract the identity as it has order $1$. So $7$ elements of order $2$.

How many elements of $\mathbb Z_4 \oplus \mathbb Z_2 \oplus \mathbb Z_2$ have order $4$?
We have to pick an element of order $4$, and the only ones are in $\mathbb Z_4$. We can choose the other two elements freely. Hence the answer is $2\times2^2=8$.
A: This is a fairly simple way
For $\mathbb{Z} _8 \times \mathbb {Z} _2$.
Note $2(a,b)=0$ iff $2a=0$ and $2b=0$, then $a\in\{0,4\}  $ and $b\in \mathbb {Z} _2$. So there are $2\cdot 2=4$ possibilities for $|(a,b)|=2 $, but $|(0,0)|=1<2 $. Thus there are $4-1=3$ elements of order $2$ in $\mathbb{Z} _8 \times \mathbb {Z} _2$.
Similarly,  $4(a,b)=0$ iff $4a=0$ and $4b=0$, then $a\in\{0,2,4,6\}  $ and $b\in \mathbb {Z} _2$. So there are $4\cdot 2=8$ possibilities for $|(a,b)|=4 $, but we have found $4$ elements not having order $4$, which means that $8-4=4$ elements have order $4$.
