Let $\mathcal{T}_n$ be the set of $n \times n$ matrices such that $X\in \mathcal{T}_n$ can be written as: $$X = \bigl( \begin{array}{cc} 1 & \overline{0} \\ T & \underline{0} \end{array} \bigr) $$ Such that $\overline{0}$ and $\underline{0}$ are the $n-1$ dimensional row vector and column vector of zeros respectively and $T$ is a binary $(n-1) \times (n-1)$ lower triangular matrix with exactly one "1" in each row.
Let $\mathcal{P}_n$ be the set of matrices $$Y = \bigl( \begin{array}{cc} 1 & \overline{0} \\ \underline{0} & P \end{array} \bigr) $$ Such that $P$ is an $(n-1) \times (n-1)$ permutation matrix. We define an indicator function for every $X \in \mathcal{T}_n$ and $Y \in \mathcal{P}_n$ as follows: $$ I(X,Y) = \left\{ \begin{array}{l l} 1 & \quad \text{if $YXY^{-1} \in \mathcal{T}_n$}\\ 0 & \quad \text{otherwise} \end{array} \right.$$
Question: Calculate $Z(n) = \sum_{X \in \mathcal{T}_n} \sum_{Y \in \mathcal{P}_n} I(X,Y)$.
The first thing that I noticed is that $\mathcal{T}_n$ does not form a group (it's not closed under taking inverses) but it does form a semigroup and I hoped to find a slick proof using this fact. I have also attempted to find an appropriate recursion/ induction argument to solve this problem but so far I have failed on both counts.