Determinants of striped Hankel matrices This question is related to the matrices described in Deyi Chen's recent MO post (look at some examples there). The main difference: we are asking for a determinant evaluation instead of a permanent, plus we have added variables. Define the sequence
$$f_n=\mathrm{det}\left[x_{i-j}\cdot\operatorname{sgn} \left(\tan\frac{(i+j)\pi}{2n+1} \right)\right]_{1\le i, \,j\le 2n},$$
where $n\geq1$ and $\operatorname{sgn}$ is the sign-function; i.e. $\operatorname{sgn}(y)=1$ if $y>0$; $\operatorname{sgn}(y)=-1$ if $y<0$; $\operatorname{sgn}(0)=0$.
If we set all $x_k=1$, user44191 offers an alternative description of the matrix: $n−1$ antidiagonals of $1$'s, $n$ antidiagonals of $-1$'s, an antidiagonal of $0$'s, $n$ antidiagonals of $1$'s, and $n-1$ antidiagonals of $-1$'s, in the given order.

QUESTION 1. Is this true? The determinant equals $f_n=(-1)^nP(\dots,x_{-2},x_{-1},x_0,x_1,x_2,\dots)^2$ for some squared polynomial $P$ of several variables (coefficients in $\mathbb{Z}$) so that each of its monomials is of the form $x_{i_1}x_{i_2}\cdots x_{i_m}$ with $i_1+i_2+\cdots+i_m=0$.


QUESTION 2 (specialization). Is this true? If we set $x_k=1$, for all $k$, then $f_n=(-1)^n$.

Example. For instance,
$$f_2=
\det\left[ \begin {array}{cccc} 
x_0&-x_{-1}&-x_{-2}&0\\ 
-x_1&-x_0&0&x_{-2} \\
-x_2&0&x_0&x_{-1}\\ 
0&x_2&x_1&-x_0
\end {array} \right]
=(x_{-2}x_2-x_{-1}x_1-x_0^2)^2.$$
Example. The matrix for $n=3$ and its determinant:
$$
\left[ \begin {array}{cccccc} x_0&x_{-1}&-x_{-2}&-x_{-3}&-x_{-4}&0\\ 
x_1&-x_0&-x_{-1}&-x_{-2}&0&x_{-4}\\ 
-x_2&-x_1&-x_0&0&x_{-2}&x_{-3}\\ 
-x_3&-x_2&0&x_0&x_{-1}&x_{-2}\\ 
-x_4&0&x_2&x_1&x_0&-x_{-1}\\ 
0&x_4&x_3&x_2&-x_1&-x_0
\end {array} \right],
$$
\begin{align*}
f_3&=-(x_{-4}x_0x_4 - x_{-4}x_{1}x_3 + x_{-4}x_2^2 - x_{-3}x_{-1}x_4 + x_{-3}x_0x_3 \\
& \qquad + x_{-3}x_1x_2 + x_{-2}^2x_4 + x_{-2}x_{-1}x_3 - 2x_{-2}x_0x_2 \\
& \qquad - x_{-2}x_1^2 - x_{-1}^2x_2 - x_0^3)^2.
\end{align*}
 A: to Question 1: Yes.
To prove this, let me fix a positive integer $n$ and denote your matrix (whose
determinant $f_{n}$ is) by $A$. The notation $\left[  k\right]  $ shall be
used for the set $\left\{  1,2,\ldots,k\right\}  $ whenever $k$ is an integer.
The notation $M_{i,j}$ will be used for the $\left(  i,j\right)  $-th entry of
any matrix $M$. Thus,
\begin{equation}
A_{i,j}=x_{i-j}\cdot\operatorname*{sgn}\left(  \tan\dfrac{\left(  i+j\right)
\pi}{2n+1}\right)
\label{eq.darij1.1}
\tag{1}
\end{equation}
for any $i,j\in\left[  2n\right]  $.
Let $B$ be the $2n\times2n$-matrix obtained by "turning $A$ upside down",
i.e., reversing the order of the rows of $A$. Explicitly, this means that
\begin{equation}
B_{i,j}=A_{2n+1-i,j}\qquad\text{for all }i,j\in\left[  2n\right]
.
\label{eq.darij1.2}
\tag{2}
\end{equation}
We note that $B$ can be obtained from $A$ by $n$ row-swaps (i.e., by $n$
steps, where each step swaps a pair of rows). Indeed, all we need to do is to
swap the $1$-st and the last row, then to swap the $2$-nd and the
$2$-nd-to-last row, etc., until we reach the middle of the matrix. Since each
of these swaps multiplies the determinant by $-1$, this entails that
\begin{equation}
\det B=\left(  -1\right)  ^{n}\det A.
\label{eq.darij1.3}
\tag{3}
\end{equation}
Now, I claim that the matrix $B$ is alternating -- i.e., that
\begin{equation}
B_{i,i}=0\qquad\text{for all }i\in\left[  2n\right]
\label{eq.darij1.4}
\tag{4}
\end{equation}
and
\begin{equation}
B_{i,j}=-B_{j,i}\qquad\text{for all }i,j\in\left[  2n\right]
.
\label{eq.darij1.5}
\tag{5}
\end{equation}
Indeed, in order to prove \eqref{eq.darij1.4}, it suffices to observe that
\begin{align*}
B_{i,i}  & =A_{2n+1-i,i}=x_{\left(  2n+1-i\right)  -i}\cdot\operatorname*{sgn}
\left(  \tan\dfrac{\left(  \left(  2n+1-i\right)  +i\right)  \pi}
{2n+1}\right)  \\
& =x_{2n+1-2i}\cdot\underbrace{\operatorname*{sgn}\left(  \tan\dfrac{\left(
2n+1\right)  \pi}{2n+1}\right)  }_{=\operatorname*{sgn}\left(  \tan\pi\right)
=\operatorname*{sgn}0=0}=0.
\end{align*}
The proof of \eqref{eq.darij1.5} is not much harder (using the fact that
$\dfrac{\left(  2n+1-i+j\right)  \pi}{2n+1}=\pi-\dfrac{\left(  i-j\right)
\pi}{2n+1}$ and therefore
\begin{align}
\tan\dfrac{\left(  2n+1-i+j\right)  \pi}{2n+1}=\tan\left(  \pi-\dfrac{\left(
i-j\right)  \pi}{2n+1}\right)  =-\tan\dfrac{\left(  i-j\right)  \pi}{2n+1},
\end{align}
and furthermore $\tan$ is an odd function).
Thus, we know that the matrix $B$ is alternating. Hence, as for any
alternating $2n\times2n$-matrix, its determinant is the square of its
Pfaffian. In other words,
\begin{equation}
\det B=\left(  \operatorname*{Pf}B\right)  ^{2},
\label{eq.darij1.6}
\tag{6}
\end{equation}
where $\operatorname*{Pf}B$ denotes the Pfaffian of $B$. The latter Pfaffian
is a polynomial in the entries of the matrix with coefficients in $\mathbb{Z}
$. Since the entries of the matrix belong to $\mathbb{Z}\left[  \ldots
,x_{-2},x_{-1},x_{0},x_{1},x_{2},\ldots\right]  $, we thus conclude that the
Pfaffian belongs to $\mathbb{Z}\left[  \ldots,x_{-2},x_{-1},x_{0},x_{1}
,x_{2},\ldots\right]  $ as well. In other words,
\begin{equation}
\operatorname*{Pf}B\in\mathbb{Z}\left[  \ldots,x_{-2},x_{-1},x_{0},x_{1}
,x_{2},\ldots\right]  .
\label{eq.darij1.7}
\tag{7}
\end{equation}
Now, \eqref{eq.darij1.3} yields
\begin{align}
\det A=\left(  -1\right)  ^{n}\det B=\left(  -1\right)  ^{n}\left(
\operatorname*{Pf}B\right)  ^{2}
\end{align}
(by \eqref{eq.darij1.6}). Because of \eqref{eq.darij1.7}, this shows that
$\det A$ equals $\left(  -1\right)  ^{n}\cdot P^{2}$ for some polynomial
$P\in\mathbb{Z}\left[  \ldots,x_{-2},x_{-1},x_{0},x_{1},x_{2},\ldots\right]  $
(namely, for $P=\operatorname*{Pf}B$), exactly as claimed in Question 1.
In order to complete the answer to Question 1, we now need to show that each
monomial in $P=\operatorname*{Pf}B$ is of the form $x_{i_{1}}x_{i_{2}}\cdots
x_{i_{n}}$ with $i_{1}+i_{2}+\cdots+i_{n}=0$. This can be done in various
ways, but the easiest is probably the following: Let us equip the polynomial
ring $\mathbb{Z}\left[  \ldots,x_{-2},x_{-1},x_{0},x_{1},x_{2},\ldots\right]
$ with a $\mathbb{Z}$-grading in which each indeterminate $x_{i}$ is
homogeneous of degree $i$. Now, recall the explicit formula for the Pfaffian
as a sum over all perfect matchings on the set $\left[  2n\right]  $ (see Definition 3 in Michel Goemans, 18.438 in Spring 2014, Lectures 4 and 6, or any
good textbook on Pfaffians). If
\begin{equation}
M=\left\{  \left\{  a_{1},b_{1}\right\}  ,\left\{  a_{2},b_{2}\right\}
,\ldots,\left\{  a_{n},b_{n}\right\}  \right\}
\label{eq.darij1.9o}
\tag{9}
\end{equation}
is such a perfect matching, then the corresponding addend in
$\operatorname*{Pf}B$ is
\begin{equation}
\pm B_{a_{1},b_{1}}B_{a_{2},b_{2}}\cdots B_{a_{n},b_{n}}.
\label{eq.darij1.9}
\tag{10}
\end{equation}
Each of the $n$ factors $B_{a_{i},b_{i}}$ in this product can be rewritten as
\begin{align}
B_{a_{i},b_{i}}=A_{2n+1-a_{i},b_{i}}=x_{\left(  2n+1-a_{i}\right)  -b_{i}
}\cdot\left(  1\text{ or }-1\text{ or }0\right)  ,
\end{align}
and thus (using our weird grading) is homogeneous of degree $\left(
2n+1-a_{i}\right)  -b_{i}=2n+1-a_{i}-b_{i}$. Hence, the entire product
\eqref{eq.darij1.9} is homogeneous of degree
\begin{align*}
\sum_{i=1}^{n}\left(  2n+1-a_{i}-b_{i}\right)    & =n\left(  2n+1\right)
-\underbrace{\sum_{i=1}^{n}\left(  a_{i}+b_{i}\right)  }
_{\substack{=1+2+\cdots+2n\\\text{(since \eqref{eq.darij1.9o} is
a}\\\text{perfect matching of }\left[  2n\right]  \text{)}}}\\
& =n\left(  2n+1\right)  -\left(  1+2+\cdots+2n\right)  =0.
\end{align*}
This means that this product is a $\mathbb{Z}$-linear combination of monomials
of the form $x_{i_{1}}x_{i_{2}}\cdots x_{i_{n}}$ with $i_{1}+i_{2}
+\cdots+i_{n}=0$. Clearly, the same must therefore holds for the polynomial
$\operatorname*{Pf}B$ (since this polynomial is a sum of such products). This
concludes the answer to Question 1.
Answering Question 2 requires proving that $\det B=1$ when all $x_{i}$ are set
to $1$. This should be easy given that $\operatorname*{sgn}\left(  \tan
\dfrac{\left(  i+j\right)  \pi}{2n+1}\right)  $ can be explicitly computed
(and the matrix $B$ becomes a circulant when all $x_{i}$ are $1$); but it's
late here and I have too many things on my list until the quarter begins. Sorry!
