Presentation of $\mathbb Z_n\rtimes _{\phi}Q_8$ 
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?
 A: This just comes down to working out who $Q_8$ maps to the cyclic group of order two (which is isomorphic to $\operatorname{Aut}(\mathbb{Z}_3)$). If you want the action to be non-trivial, you want the map to be onto (although this is not generally true, you just need the image to be non-trivial).
So, write $Q_8=\langle i,j,k,x; i^2=j^2=k^2=ijk=x, x^2=1\rangle$ (Note: I am writing $x$ for $-1$, as later I will write $c^x=c$ and if I wasn't to do this I would be writing $c^{-1}=c$ which is silly...). Any non-trivial subgroup of $Q_8$ contains $x$, and so $x$ is contained in the kernel of any map $Q_8\twoheadrightarrow\mathbb{Z}_2$. The image of $Q_8/\langle x\rangle$ is the Klein $4$-group, which maps onto the cyclic group of order two in three ways. Therefore, there are three choices for $\phi$.
In these three automorphisms you always have $c^{x}=c$, and then $c^p=c^{-1}$ for $p\in\{i, j, k\}$ which wasn't killed by our map to the cyclic group of order two, and $c^p=c$ otherwise. The three groups are the following.
$$\begin{align*}
\langle i,j,k,x, c&; i^2=j^2=k^2=ijk=x, x^2=1, c^2=1, c^x=c, c^i=c^{-1}, c^j=c^{-1}, c^k=c\rangle\\
\langle i,j,k,x, c&; i^2=j^2=k^2=ijk=x, x^2=1, c^2=1, c^x=c, c^i=c^{-1}, c^j=c, c^k=c^{-1}\rangle\\
\langle i,j,k,x, c&; i^2=j^2=k^2=ijk=x, x^2=1, c^2=1, c^x=c, c^i=c, c^j=c^{-1}, c^k=c^{-1}\rangle
\end{align*}$$
A: 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.
