# Writing numbers on the top of the matrix as shown in figure

I'm trying to write numbers on a matrix as shown in the figure. Please help in this issue. Thank you so much for your time.

You can do that with blockarray:

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blkarray, bigstrut}

\begin{document}

\begin{frame}
$\bigstrutjot=5pt X = \begin{blockarray}{*{7}{c}} & 1 & 2 & \dots & j & \dots &n \\ \begin{block}{r[*{6}{c}]}% 1 & & & & & & \bigstrut[t]\\ 2 & & & & & & \\ \vdots & & & & & & \\ i & & & & & & \\ \vdots & & & & & & \\ m & & & & & & \bigstrutjot = 3pt\bigstrut[b]\\ \end{block}\ \end{blockarray}$
\end{frame}

\end{document}