How can you calculate the rank of an nxn matrix with the given conditions? Let $A=(a_{i,j})$ a square matrix whose elements are:

*

*$0$ if $i=j$.

*$1$ if $j>i$.

*$-1$ if $j<i$.

Is there a simple way to find its rank?
 A: that was neat. Same rank as the matrix with entry $1$ when $j=i+1,$ then $-1$ when $j=i-1,$ otherwise $0$
Congruence:
$$ \tiny
\left(
\begin{array}{rrrrr}
1&0&0&0&0 \\
0&1&0&0&0 \\
0&-1&1&0&0 \\
0&0&-1&1&0 \\
0&0&0&-1&1 \\
\end{array}
\right)
\left(
\begin{array}{rrrrr}
0&1&1&1&1\\
-1&0&1&1&1 \\
-1&-1&0&1&1 \\
-1&-1&-1&0&1 \\
-1&-1&-1&-1&0 \\
\end{array}
\right)
\left(
\begin{array}{rrrrr}
1&0&0&0&0 \\
0&1&-1&0&0 \\
0&0&1&-1&0 \\
0&0&0&1&-1 \\
0&0&0&0&1 \\
\end{array}
\right) =
\left(
\begin{array}{rrrrr}
0&1&0&0&0 \\
-1&0&1&0&0 \\
0&-1&0&1&0 \\
0&0&-1&0&1 \\
0&0&0&-1&0 \\
\end{array}
\right)
$$
The final matrix is the Skew Normal Form in Newman, especially pages 56-60.

The process is now repeated with $E$ until the canonical form
described by the theorem is obtained, and the procedure makes it clear
that the rank of $A$ must be even.

Once the matrix is in this normal form, the new null  (zero eigenvector)vector(s) becomes quickly  apparent: none when $n$ even, exactly one when $n$ is odd, namely $(1,0,1,0,1)^T$ and multiplied by any constant.
A: checking the determinant, we see that
$\det\big(A\big)= \det\big(A^T\big)= \det\big(-I_nA\big)= \det\big(-I_n\big)\cdot\det(A\big) = (-1)^n\cdot \det(A\big)$
so  $n$ is odd$\implies$$A$ is singular.
Now it suffices to show that the matrix is invertible if $n$ is even. (When $n$ is odd, let $n':=n-1$ and consider the leading $n'\times n'$ principal submatrix -- if we show this is invertible, then $\text{rank}\big(A\big) = n'$.)
I suspect you're working over reals.  Since all components of $A$ are integers, we may as well change the field to rationals, $\mathbb Q$ which doesn't change rank, ref Does real dimension equal rational dimension?
By assumption $n$ is even and it suffices to show $\det\big(A\big)\%2 \neq 0$. This is equivalent to changing the field to $\mathbb F_2$ and then calculating the determinant.
In $\mathbb F_2$ we have $A= - I+\mathbf {11}^T= I+\mathbf {11}^T$
(note: since $-1=1$ in $\mathbb F_2$, then $-I=I$)
By the matrix determinant lemma:
$$
\begin{align}    
&\det\big(A\big)\\   
&= \det\big(I+\mathbf {11}^T\big)\\  
&= \det\big(I\big)\cdot \big(1+\mathbf {1}^T(I)^{-1}\mathbf 1\big)\\  
&= 1\cdot \big(1+\mathbf {1}^T\mathbf 1\big)\\
&=1\cdot \big(1+0\big)\\  
&= 1  
\end{align}
$$
noting that $\mathbf {1}^T\mathbf 1 = \big(\sum_{k=1}^n 1\big) = 0 $ in $\mathbb F_2$ since $n$ is even.
Thus when $n$ is even, $\det\big(A\big)$ is odd, and therefore non-zero, which completes the proof.
A: Here's a sneakier solution.
It suffices to prove $n-1\leq \text{rank}\big(A\big)$
$R:=A +\mathbf{11}^T$
$R$ has zeros below the diagonal so it is upper triangular and it has ones on the diagonal so $\text{rank}\big(R\big)=n$.  Rank is sub-additive (ref: Show that $\operatorname{rank}(A+B) \leq \operatorname{rank}(A) + \operatorname{rank}(B)$) so we have
$n =\text{rank}\Big(R\Big) = \text{rank}\Big(A +\mathbf{11}^T\Big)\leq \text{rank}\Big(A \Big) + \text{rank}\Big(\mathbf{11}^T\Big)=\text{rank}\Big(A\Big) + 1$
$\implies n-1\leq \text{rank}\Big(A\Big)$
====
(i) When $n$ is odd, since $A=-A^T$, checking the determinant, we see that $\det\big(A\big) = 0$, so $n-1\leq \text{rank}\Big(A\Big)\leq n-1$, i.e. $\text{rank}\Big(A\Big) = n-1$.
(ii) Now for even $n$, the above tells us $\text{rank}\Big(A\Big)\in\big\{n-1,n\big\}$.
$\text{rank}\Big(A\Big)=n-1\implies A$ has an $n-1\times n-1$ principal submatrix that is invertible, see Prove the existence of a principal submatrix of order $r$ in $M\in\Bbb F^{n\times n}, M=-M^T,\ \operatorname{rank}(M)=r$  but this invertible $n-1\times n-1$ principal submatrix is odd dimensional and skew symmetric, so it must have a determinant of zero, a contradiction.  Thus for even $n$, we know $\text{rank}\Big(A\Big)=n$
