TITLE: Presentation of $\mathbb Z_n\rtimes _{\phi}Q_8$
QUESTION [5 upvotes]: Regarding to this answer, I am looking for the presentation of $\mathbb Z_n\rtimes _{\phi}Q_8$, where
  $$Q_8=\langle a,b\mid a^4=1, a^2=b^2, ba=a^3b\rangle=\{1,a,a^2,a^3,b,ab,a^2b,a^3b\}, ~~\mathbb Z_n=\langle c\rangle.$$

Here, for simplicity for myself, I set $n=3$, so : $$\mathbb Z_3\rtimes _{\phi}Q_8 \;=\; \langle a,b,c \mid a^4=1, a^2=b^2, ba=a^3b, c^3=1, yx=\phi_y(x)y\rangle$$ in which $y\in Q_8,~~x\in\mathbb Z_3$ and $\phi: Q_8\to Aut(\mathbb Z_3)$. The problem is really to define this homomorphism $\phi$ appropriately. Clearly, $\phi_y(1)=1$ and I have $$\phi_{a^i}(x)=?,~~\phi_{a^jb}(x)=?,~~\phi_b(x)=?, 1\leq i\leq3,~~1\le j\le 3$$ I thinking to myself to define $\phi_{a^i}(x)=id_{\mathbb Z_3}$ just to get rid of one part. Am I on a right way? Any suggestions?

REPLY [2 votes]: It depends on $n$, really. Note that if $n = 2^{m}$, with $m \ge 3$, then $\operatorname{Aut}(G)$ is not cyclic, where $G = \mathbb{Z}_{n}$. Rather, it is the direct product of a cylic group of order $2$, and a cyclic group of order $2^{m-2}$. 
So for instance when $n = 8$ you have, besides the groups similar to those mentioned in another answer, a group where
$$
c^{i} = c^{-1}, c^{j} = c^{3}, c^{k} = c^{-3},
$$
and variations.