I would like to show that $K$ is a generator for $\mathbb{Z}_n$ $\iff$ $\gcd(K,n)=1$ and $1 \leq K <n$.
My Attempt:
Assume $\gcd(K,n)=1$ and $1 \leq K <n$. That means $K \in \mathbb{Z}_n$ and so it suffices to show that $\mathbb{Z}_n\subset \langle K\rangle$ . Let $x \in \mathbb{Z}_n$ be arbitrary and so by bezouts lemma, there exists integers $a,b$ such that $aK+yn=1$, hence $x=x^{aK+yn}=x^{aK}$ (since $\mathbb{Z}_n$ under addition is cyclic). But $x^{aK}=(aK)x=(ax)K$ and so $x \in \langle K\rangle$. Is this proof so far correct? How would I prove the other direction?
It seems correct, yes. For the other direction I'd suggest contrapositive. If $\text{gcd}(K,n)=m,$ then $$\text{lcm}(K,n)=Kn/m=K(n/m),$$ so $K$ has order $n/m,$ and $\left<K\right>$ has $n/m$ elements. So if $m\not=1,$ then $\left<K\right>$ has less than $n$ elements, and $\left<K\right>\not=\mathbb{Z}_n.$