How many transvections are in a maximal unipotent subgroup of a general linear group? 
If G is a general linear group GL( n, q ) of characteristic p, and U is a Sylow p-subgroup of G, then how many elements of U are transvections?

The size of a centralizer of a transvection is relevant.
If $g = \left[\begin{smallmatrix}
1 & 1 & . & . & . & . \\
. & 1 & . & . & . & . \\
. & . & 1 & . & . & . \\
. & . & . & 1 & . & . \\
. & . & . & . & 1 & . \\
. & . & . & . & . & 1 \\
\end{smallmatrix}\right],$ then $C_{GL}(g) = \left\{\left[ \begin{smallmatrix}
a & * & * & * & * & * \\
. & a & . & . & . & . \\
. & * & * & * & * & * \\
. & * & * & * & * & * \\
. & * & * & * & * & * \\
. & * & * & * & * & * \\
\end{smallmatrix}\right]\right\},$ and so $C_U(g) = \left\{\left[ \begin{smallmatrix}
1 & * & * & * & * & * \\
. & 1 & . & . & . & . \\
. & . & 1 & * & * & * \\
. & . & . & 1 & * & * \\
. & . & . & . & 1 & * \\
. & . & . & . & . & 1 \\
\end{smallmatrix}\right]\right\}.$
Then $g^x = \left[ \begin{smallmatrix}
1 & 1 & * & * & * & * \\
. & 1 & . & . & . & . \\
. & . & 1 & . & . & . \\
. & . & . & 1 & . & . \\
. & . & . & . & 1 & . \\
. & . & . & . & . & 1 \\
\end{smallmatrix}\right]$ for all $x = \left[\begin{smallmatrix}
1 & . & . & . & . & . \\
. & 1 & * & * & * & * \\
. & . & 1 & . & . & . \\
. & . & . & 1 & . & . \\
. & . & . & . & 1 & . \\
. & . & . & . & . & 1 \\
\end{smallmatrix}\right].$
The U-conjugacy class of G has $q^{n-2}$ elements. However, there are other transvections, and I'm not so sure how to count them all.
Checking small $(n,q)$ I get a possible formula:
$$ nq^{n-1} - \tfrac{q^n-1}{q-1}$$
In particular, I don't get that each transvection must look like a "row", and I don't get that every element is a transvection. It'd be nice to know what they "look" like as matrices.
Just in case I made a mistake in linear algebra: To check if an element g is a transvection, I check that $\operatorname{Rank}(g-1) = 1$ and $(g-1)^2 = 0$.
 A: Doesn't it just depend on the lowest non-zero row of $g-I$? Let's say this is row $r$ (starting counting from the bottom). Let's say that the lowest $k$ rows of $g-I$ are zero, but the next one up isn't. If I'm counting right, there are $q^{k}-1$ ways to complete that row with a non-zero vector, then, given that choice, $q^{n-k-1}$ ways to fill out the rows above that so that $g-I$ has rank $1.$ So the answer looks like $\sum_{k=1}^{n-1} (q^{n-1} - q^{n-k-1}).$ I think this agrees with what you wrote.
A: This answer is just for reference on transvections in GL( n, K ).  One can skip the conjugacy section without affecting the argument.  An element $g$ of $U$ has the property that it stabilizes the standard maximal flag:
$$e_k g = e_k + v \qquad \text{for some } v \in \langle e_{k+1}, \dots, e_n \rangle$$
Appearance of transvections
Let $g \in U$ be a transvection. Set $i = \max\{ i : e_i g \neq e_i \}$. Since $g \neq 1$, $i < \infty$, and since $g \in U$, $i < n$. Set $j = \max\{ g e_i - e_i \notin \langle e_j, e_{j+1}, \dots, e_n \rangle \}$. Since $e_ig \neq e_i$, $j \leq n$ and since $g\in U$, $i \leq j$. Write $e_ig = e_i + \alpha e_j + v$ for $v \in \langle e_{j+1}, \dots e_n\rangle$. Then we have the following formula for $e_k g$:
$$e_k g = \begin{cases}
e_k & \text{ if } k > i \\
e_i + \alpha e_j + v & \text{ if } k = i \\
e_k + \beta_k( \alpha e_j + v) & \text{ if } k < i 
\end{cases}$$
where the $\beta_k$ follows form the assumption $g-1$ has rank 1.
For example, if $n=8$, $i=3$, and $j=5$, then any choice of $\alpha \in k^\times$ and
$\beta \in k^{i-1}$ and $v \in k^{n-j}$ gives a transvection such as the following:
$$g(3,5,\alpha;\beta, v) = \left[\begin{smallmatrix}
1 & . & . & . & \beta_1 \alpha & \beta_1 v_1 & \beta_1 v_2 & \beta_1 v_3 \\
. & 1 & . & . & \beta_2 \alpha & \beta_2 v_1 & \beta_2 v_2 & \beta_2 v_3 \\
. & . & 1 & . & \alpha & v_1 & v_2 & v_3 \\
. & . & . & 1 & . & . & . & . \\
. & . & . & . & 1 & . & . & . \\
. & . & . & . & . & 1 & . & . \\
. & . & . & . & . & . & 1 & . \\
. & . & . & . & . & . & . & 1 \\
\end{smallmatrix}\right]
$$
In other words, pick a corner $(i,j)$ and a nonzero entry $\alpha$ for it, then fill in the rest of the rectangle (growing up and right) with a rank 1 matrix $[\beta;1] \times [\alpha,v]$. As a block matrix we have:
$$g = \begin{bmatrix} I & u^t v \\ 0 & I \end{bmatrix} \qquad u,v \text{ row vectors }$$
Conjugacy classes of transvections

In this optional section, we show that for each fixed $i,j,\alpha$, all $g(i,j,\alpha;\beta,v)$ form a conjugacy class of size $q^{i+n-j}$ with representative the standard transvection $E_{ij}(\alpha)$ from linear algebra courses.

Set $h$ to be the transvection given by:
$$e_k h = \begin{cases}
e_j + \alpha^{-1} v & \text{if } k = j \\
e_k & \text{if } k \neq j \\
\end{cases}$$
Calculate $e_k h g h^{-1}$ to be in a nice form:
$$e_k h g h^{-1} = \left\{\begin{array}{lllll}
    (e_j + \alpha^{-1} v) g h^{-1} 
& = (e_j + \alpha^{-1} v) h^{-1} 
& = e_k & \text{if } k = j \\
    e_k g h^{-1}
& = e_k h^{-1}
& = e_k & \text{if } k > i, k \neq j \\
    e_k g h^{-1}
& = (e_i + \alpha e_j + v) h^{-1}
& = e_k + \alpha e_j & \text{if } k = i \\
    e_k g h^{-1}
& = (e_k + \beta_k (\alpha e_j + v) ) h^{-1} 
& = e_k + \beta_k \alpha e_j & \text{if } k < i
\end{array}\right.
$$
In particular $g(\alpha,\beta,v)^{h^{-1}} = g(\alpha,\beta,0)$ shows
each conjugacy class contains a transvection with $g-1$ having only one 
nonzero column.
Now assume $v=0$ and redefine $h$ as:
$$e_k h = \begin{cases}
e_k - \beta_k e_i \  & \text{if } k < i \\
e_k & \text{if } k \geq i \\
\end{cases}$$
Calculate $e_k h g h^{-1}$ to be in a nice form:
$$e_k h g h^{-1} = \left\{\begin{array}{lllll}
    e_k g h^{-1} 
& = e_k h^{-1} 
& = e_k & \text{if } k > i \\
    e_k g h^{-1}
& = (e_k + \alpha e_j) h^{-1}
& = e_k + \alpha e_j & \text{if } k = i \\
    (e_k - \beta_k e_i ) g h^{-1}
& = (( e_k + \beta_k \alpha e_j) - \beta_k( e_i +  \alpha e_j ) ) h^{-1} 
& = ( e_k - \beta_k e_i ) h^{-1} = e_k
& \text{if } k < i
\end{array}\right.
$$
In particular, $g^{h^{-1}} = g(\alpha,0,0)$ so that every transvection
is $U$-conjugate to one with $\beta=v=0$, that is, to a standard
transvection $E_{ij}(\alpha)$.
Since $i,j$ are defined in terms of the maximal flag, distinct $i,j$ correspond to distinct conjugacy classes, even in $N_G(U)$. [XXX: distinct $\alpha$ are not conjugate in $U$]
[XXX: explicit centralizer of $E_{i,j}(\alpha)$]
Counting the transvections
Hence we get a sum that is basically just nested geometric series:
$$\begin{array}{rl}
\#T
&= \sum_{i=1}^{n} \sum_{j=i+1}^n \sum_{\alpha \in k^\times} \left|E_{ij}(\alpha)^U\right| \\
&= \sum_{i=1}^{n} \sum_{j=i+1}^n \sum_{\alpha \in k^\times} \sum_{\beta \in k^{i-1}} \sum_{v \in k^{n-j}} 1 \\
&= \sum_{i=1}^{n} \sum_{j=i+1}^n \sum_{\alpha \in k^\times} q^{(i-1)+(n-j)} \\
&= \tfrac{q-1}{q} \sum_{i=1}^{n} q^i \sum_{j=i+1}^n q^{n-j} \\
&= \tfrac{q-1}{q}\sum_{i=1}^{n} q^i \sum_{j=0}^{n-i-1} q^j \\
&= \tfrac{q-1}{q}\sum_{i=1}^{n} q^i \frac{q^{n-i}-1}{q-1} \\
&= \tfrac{q-1}{q}\sum_{i=1}^{n} \frac{q^{n}-q^i}{q-1} \\
&= \tfrac{1}{q}\sum_{i=1}^{n} q^{n}-q^i \\
&= \tfrac{1}{q}\left( n q^{n} - \frac{q^{n+1}-q}{q-1} \right) \\
&= n q^{n-1} - \frac{q^n-1}{q-1}
\end{array}$$
