TITLE: Determinant of a matrix having diagonal and subdiagonal entries zero
QUESTION [8 upvotes]: I have found the determinant of the following matrix of order $n\ge3$ using some elemetary operations 
$$\begin{bmatrix}0& 1 & 1& \dots & 1 \\ 0 & 0 & 1& \ddots & 1\\ 1 & 0 & 0 & \ddots & 1 \\ \vdots & \ddots & \ddots & \ddots & 1 \\ 1 & 1 & 1 & \dots & 0 \end{bmatrix}_{n\times n},$$ that is, a matrix which have diagonal, subdiagonal entries zero and rest of entries are equal to 1. Its determinant comes out to be equal to $$(-1)^n\Big(\lfloor\frac{n-2}{2}\rfloor\Big),$$ where,  $\lfloor.\rfloor$ is the floor function. Now, I want to find determinant of the following matrix 
$$ 
\begin{bmatrix}0& -1 & 1& \dots & 1 \\ 0 & 0 & -1& \ddots & 1\\ 1 & 0 & 0 & \ddots & 1 \\ \vdots & \ddots & \ddots & \ddots & -1\\ 1 & 1 & 1 & \dots & 0 \end{bmatrix}_{n\times n},$$ that is, a matrix having diagonal and subdiagonal entries zero. Superdiagonal elements are -1 and rest of the entries are equal to 1.

REPLY [3 votes]: I will try to give a different explicit solution.  From the problem formulation of answer 1,  $$\det(A+uu^T)=(1+u^TA^{-1}u).\det(A).$$ From here, we need to solve some recursive expressions, in order to calculate the determinant and inverse of $A$. I solve these recursive expressions using roots of their characteristic equations. For the determinant of $A$, recursive expression is $$f_n=-f_{n-1}-2f_{n-2},\ \ \ \ \ f_0=1,\ f_{-1}=0.$$  Roots of the resulting characteristic equation $x^2+x+2=0,$ are $$ s_1=\frac{-1}{2}+ \frac{\iota \sqrt{7}}{2},\ \ s_2=\frac{-1}{2}- \frac{\iota \sqrt{7}}{2}.$$ Hence,   $$\det(A)=f_n=r_1.s_1^n+r_2.s_2^n,$$ where, using initial conditions $$r_1=\frac{1}{2} +\frac{\iota }{2\sqrt{7}},\ \ r_2=\frac{1}{2} -\frac{\iota }{2\sqrt{7}}.$$ 
Now, to calculate $A^{-1}$ we need to solve following recursive expressions $$g_i=-g_{i-1}-2g_{i-1}, \ \text{for} \ \ i=2, 3\dots,n,\ \  g_0=1,\ g_1=-1$$    $$ h_i=-h_{i+1}-2h_{i+2}, \ \text{for} \ \ i=n-1,\dots,1, \ \ h_{n+1}=1,\ h_{n}=-1.$$ Similar to $f_n$, solving these recursive expressions we get $$g_i=r_{1}.s_1^i+r_{2}.s_2^i.$$ And, $$h_i=r_{h1}.s_1^{n-i}+r_{h2}.s_2^{n-i},$$ where, $$r_{h1}=\frac{-1}{2}-\frac{3}{2\iota\sqrt(7)},\ \ \ r_{h2}=\frac{-1}{2}+\frac{3}{2\iota\sqrt(7)}.$$ Entries of $A^{-1}$ are clearly given by $g_i, h_i$ (here). 
$$A^{-1}_{ij}=\begin{cases}\frac{2^{j-i}g_{i-1}h_{j+1}}{g_n}
 & \mbox{if $i\le j$}
\\ \frac{g_{j-1}h_{i+1}}{g_n} &\mbox{if $j< i$}
\end{cases}.$$