This question absolutely stumped me on my latest discrete maths exam. Looking to be pointed in the right direction so I can learn from it.
Let $p\geq 3$ be a prime. In general, how many elements in $\mathbb{Z}/(2p)\mathbb{Z}$ are invertible?
My only lead towards an answer is I know that $\forall [x] \in \mathbb{Z}/(p)\mathbb{Z} : \gcd(x, p) = 1$, or in other words, all $[x]$ are invertible in $\mathbb{Z}/(p)\mathbb{Z}$. How could I go from this knowledge to the number of invertible elements in $\mathbb{Z}/(2p)\mathbb{Z}$, or am I even on the right track?
There are $p$ multiples of $2$ between $0$ and $2p-1$.
There are $2$ multiples of $p$ between $0$ and $2p-1$.
There is $1$ multiple of $2p$ between $0$ and $2p-1$.
Therefore, there are $2p-2-p+1=\bbox[5px,border:2px solid red]{p-1}$ numbers relatively prime to $2p$ (invertible mod $2p$)
between $0$ and $2p-1$.
Using the Euler totient function, $\phi(2p)=\phi(2)\phi(p)=\phi(p)=p-1$.