an element of especial order in General linear group Consider General linear group $G=GL(n,q)$. Let $d$ is an arbitrary number and let there is an element in $G$ of order $d$. Is there any routine way to find this element?   
 A: Short answer: Rational canonical form.
Suppose $g \in \newcommand{\GL}{\operatorname{GL}}\GL(n,q)$ has order $d$. Then the minimal polynomial of $g$ (1) has degree at most $n$, (2) divides $x^d-1$, and (3) does not divide $x^i-1$ for any $1 \leq i \leq d$. Conversely, given any such polynomial of degree $m \leq n$, its companion matrix is an element of order $d$ in $\GL(m,q)$ and there is a natural embedding of $\GL(m,q) \leq \GL(n,q)$.
For instance, there is an element of $\GL(5,3)$ of order $13$ with minimal polynomial $x^4+x+1$, so we form the companion matrix $M$ of $x^4+x+1$, and then embed it as $M_5$ in $\GL(5,3)$: $$M=\begin{bmatrix} 
 0 & 0 & 0 & -1 \\
 1 & 0 & 0 & -1 \\
 0 & 1 & 0 & 0  \\
 0 & 0 & 1 & 0 \\
\end{bmatrix},  \qquad
M_5 = \begin{bmatrix} 
 0 & 0 & 0 & -1 & 0 \\
 1 & 0 & 0 & -1 & 0 \\
 0 & 1 & 0 & 0 & 0 \\
 0 & 0 & 1 & 0 & 0 \\
 0 & 0 & 0 & 0 & 1
\end{bmatrix}
$$
Given a possible order $d$, one can factor $x^d-1$ over $\mathbb{F}_q$ and take enough irreducible factors so that they don't divide any $x^i-1$, but not so many as to make the total degree more than $n$. This is is possible to do by what I said above. There may be more than one solution, because there can be more than one conjugacy class of elements of order $d$.
We knew there was an element of order 13 since 13 divides $3^3-1$, and this particular element of order 13 chose the irreducible factors $x-1$ and $x^3+x^2+x-1$. If you just want a “simplest” element of order 13, we would take the companion matrix $N$ of $x^3+x^2+x-1$ and embed it as $N_5$ in $\GL(5,3)$:
$$N=\begin{bmatrix} 0 & 0 & 1 \\ 1 & 0 & -1 \\ 0 & 1 & -1 \end{bmatrix}, \qquad N_5 = \begin{bmatrix} 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & -1 & 0 & 0 \\ 0 & 1 & -1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix}$$
Marc van Leeuwen gave an answer describing exactly which $d$ can occur using a similar technique.
I should say though that Don Antonio's answer is generally a better idea for specific orders. If $d$ divides $q^i-1$ for some $1 \leq i \leq n$, then one uses a block diagonal matrix with only one non-(zero or identity) block, which is a primitive $d$th root of unity in $\mathbb{F}_{q^i}^\times$. If $d$ divides $q$, then you use upper triangular matrices with 1s on the diagonal, but there is a maximum such order, and it is not related to $q$ exactly, only to $n$ and the prime divisor of $q$. If you have a number that can be factored into such numbers, then you can take an appropriate product of such matrices (being careful to arrange the blocks so that all of the factors commute). However, writing down the details of this in general is too difficult for me (though see Derek Holt's answer), and I would express it using a canonical form such as Jordan or Rational (which can be taken to coincide if you just want one element of each order).
A: I'll have a go at answering this, but I don't guarantee to get the details right.
Let $q$ be a power of the prime $p$ and write $d = d_{i_1}d_{i_2} \cdots d_{i_k}p^a$, where $1 \le i_1 < i_2 < \cdots i_k \le n$, $d_{i_j}|(q^{i_j}-1)$ and the $d_{i_j}$ are pairwise coprime.
If you can't do that then there is no element of order $d$ in ${\rm GL}(n,q)$. In fact, if $a=0$, then we need $i_1+i_2+\cdots i_k \le n$ and if $a>0$ we need $p^{a-1}+1 + i_1+i_2+\cdots i_k \le n$ (but we can manage with degree one less than that if $i_1=1$).
Assuming those conditions hold, then you can construct an element of order $d$ in ${\rm GL}(n,q)$ as a diagonal sum of elements of order $d_{i_j}$ in ${\rm GL}(i_j,q)$ and, if $a>0$, a unipotent element of order $p^a$ in ${\rm GL}(p^{a-1}+1,q)$. (But if $i_1=1$, then we can combine the unipotent element with the element in ${\rm GL}(1,q)$.)
A: For any $\,d\in\Bbb N\;$ , The element
$$A_d:=\begin{pmatrix}\zeta&0&0&\ldots&0&0\\0&1&0&\ldots&0&0\\\ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\0&0&\ldots&\ldots&0&1\end{pmatrix}\in\text{GL}_n(\Bbb C)\;,\;\;\zeta:=e^{\frac{2\pi i}{d}}$$
has order $\,d\,$ . 
If  GL$_(n,q)\;$ is meant to be the general linear group over a field with $\,q\,$ elements, $\,q\,$ a prime, then $\,d\;$ has to be a divisor of group's order...
