TITLE: Determinant and Inverse of a Toeplitz matrix
QUESTION [7 upvotes]: Let $T(n,k)$ be a $n \times n$ symmetric Toeplitz matrix, where all the entries of first $k$ super-diagonal (and sub-diagonal), last $k-1$ super-diagonal (and sub-diagonal) are ones,  and rest of the entries are zero.

Question 1. Is there a nice closed formula for the determinant $\det(T(n,k))$?
Question 2. Is there a nice expression for the inverse $T(n,k)^{-1}$?

For example $T(11, 3)$ is given by  $$\begin{bmatrix} 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1\\ 
1 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\ 
1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0  \\ 
1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0  \\ 
0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 & 0  \\ 
0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 \\ 
0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1\\
0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1  \\
1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 1  \\
1 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 
\end{bmatrix},$$ having $\det(T(n,k))=0.$

REPLY [2 votes]: I'll try to answer Q1. This determinant can be calculated with the well known companion method for banded matrices. Define the $2k \times 2k$ companion matrix (here $k=3$)
$$
\mathbf{C} = 
\left(
\begin{array}{cccccc}
 -1 & -1 & 0 & -1 & -1 & -1 \\
 1 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 \\
 0 & 0 & 1 & 0 & 0 & 0 \\
 0 & 0 & 0 & 1 & 0 & 0 \\
 0 & 0 & 0 & 0 & 1 & 0 \\
\end{array}
\right)
$$
as well as the two boundary matrices
$$
\mathbf C_1 = \mathbf C^{-1} \mathbf J_1, \qquad
\mathbf C_2 = \mathbf C \mathbf J_2,
$$
with
$$
\mathbf J_1 = \left(
\begin{array}{cccc}
 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 \\
 0 & 0 & \ddots & 0 \\
 0 & 0 & 0 & 1 \\
\end{array}
\right)\qquad
\mathbf J_2 = \left(
\begin{array}{cccc}
 1 & 0 & 0 & 0 \\
 0 & \ddots & 0 & 0 \\
 0 & 0 & 1 & 0 \\
 0 & 0 & 0 & 0 \\
\end{array}
\right).
$$
Then,
$$
\det(T(L+2k,k)) = (-1)^{k(L+1)}\det[\mathbf C^L \mathbf C_2^k - \mathbf C_1^k].
$$
The companion matrix $\mathbf C$ has eigenvalues on the unit circle (of the form $e^{\mathrm i \pi m/k}$ and $e^{\mathrm i \pi m/(k+1)}$, with integer $m$), such that it should be possible to calculate them in closed form recursively, as well as the eigenvectors. The two matrices $\mathbf C_{1,2}^k$, on the other hand, have a simple structure, as after $k$ multiplications the row of -1s is moved to the middle, e.g. for $k=5$,
$$
\mathbf C_2^k =
\left(
\begin{array}{ccccc|ccccc}
 1 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
 0 & 1 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
 0 & 0 & 1 & -1 & 0 & 0 & 0 & 1 & 0 & 0 \\
 0 & 0 & 0 & 1 & -1 & 0 & 0 & 0 & 1 & 0 \\
 -1 & -1 & -1 & -1 & 0 & -1 & -1 & -1 & -1 & 0 \\
\hline
 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
\end{array}
\right).
$$
The observed irregular behavior stems from the mixing of matrix elements in the matrix power $\mathbf C^L$ for $L>k$.
Finally some Mathematica code for your convenience...
TT[n_, k_] := Table[Switch[Abs[i - j], 0, 0, _?(0<#<=k || #>n-k &), 1, _, 0], {i, n}, {j, n}]
CC[k_] := Table[If[i == 1 && j != k, -1, If[i == j + 1, 1, 0]], {i, 2 k}, {j, 2 k}]
C1[k_] := Table[If[j == 2 k && i != k + 1, If[i == 1, 0, -1], If[i == j + 1, 1, 0]], {j, 2 k}, {i, 2 k}]
C2[k_] := Table[If[i == 1 && j != k, If[j == 2 k, 0, -1], If[i == j + 1, 1, 0]], {i, 2 k}, {j, 2 k}]
det[L_, k_] := (-1)^(k(L+1)) Det[MatrixPower[CC[k], L].MatrixPower[C2[k], k] - MatrixPower[C1[k], k]]
Table[Det[TT[2 k + L, k]] - det[L, k], {L, 0, 20}, {k, 1, 20}]