text:
\section*{Introduction}
In~\cite{CSV} the authors introduced the notion of twisted tensor product of unital $K$-algebras, where $K$ is a unital ring. We assume that $K$ is a field, and consider the
basic problem of classifying all twisted tensor products
of $A$ with $B$ for a given pair of algebras $A$ and $B$. In general this problem is out of reach, although some results have been obtained, mainly for finite dimensional algebras (see~\cite{A}, \cite{AGGV},
 \cite{C}, \cite{GGV1}, \cite{JLNS} and~\cite{LN}).
In particular, in~\cite{GGV1} some families of twisted tensor products of $K[x]$ with $K[y]$ were found. The full classification of these tensor products seems to be still out of reach, but
in~\cite{CG2} (see also~\cite{CG})  the graded twisted tensor products of $K[x]$ with $K[y]$ which yield quadratic algebras were completely classified.
On the other hand the twisted tensor product of $K[x]/\langle x^n\rangle$ with an algebra $A$ can be represented in $M_n(A)$ (see~\cite{GGV2}*{Theorem 1.10}).
This representation can be generalized to finite dimensional algebras (see~\cite{A}).

In this article we use a representation of a graded twisted tensor product of $K[x]$ with $K[y]$ in $L(K[x]^{\mathds{N}_0})$, which is very similar to the representation in~\cite{GGV2}*{Theorem 1.10},
and we manage to translate the problem of classifying
all graded twisted tensor products of $K[x]$ with $K[y]$ into the problem of classifying infinite matrices with entries in $K$ satisfying certain conditions (see Corollary~\ref{graded condition}).
With this method on the one hand we recover the classification of quadratic algebras in~\cite{CG2}, and on the other hand we get a nearly complete classification of
the graded twisted tensor products which are not quadratic.

One can describe a graded twisting tensor product of $K[x]$ with $K[y]$ by specifying how $y^k$ commutes with $x$, which means determining the $a_i$'s in
$$
y^kx=\sum_{i=0}^{k+1}a_i x^{k+1-i}y^{i}.
$$
For example the commutation relation $yx=qxy$ gives the quantum plane, and in Example~\ref{Ore} we explore the case $yx=bxy+ cy^2$. In general,
the relation $yx=ax^2+bxy+cy^2$ yields a quadratic algebra, provided that $ac\ne 1$ and that $(b,ac)$ is not a root of any member of a certain family of polynomials. If $a\ne 0$, then such a
tensor product is equivalent to one with $a=1$, and so we will focus on the case $yx=x^2+bxy+cy^2$. If $c\ne 1$, our results match the results of~\cite{CG2}, which were obtained
with very different methods.

In the case $c=1$ one can show that necessarily $b=-1$ (see Lemma~\ref{lema clasifica}) and the resulting algebras are not quadratic, i.e., they have not the 2-extension property.
We obtain a particular algebra with $y^kx=x^{k+1}-x^ky+y^{k+1}$ for all $k\in\mathds{N}$. This algebra has not the $m$-extension property for any $m$.

A central result is Proposition~\ref{clasificacion}, which shows that every graded twisted tensor product with $yx=x^2-xy+y^2$, which is not the particular case mentioned above,
satisfies $y^kx=x^{k+1}-x^ky+y^{k+1}$ for all $k<n$ for some $n\ge 2$, and then we have exactly two possibilities for $y^n x$. In the first case
$$
y^nx=dx^{n+1}-dx^n y-a xy^n+(a+1)y^{n+1},
$$
for $a,d$ in $K$ satisfying certain conditions, namely, $(a,d)$ is not a root of any member of a certain family of polynomials. This yields a family $A(n,d,a)$ of twisted tensor products with the $(n+1)$-extension property (see sections~\ref{seccion 5} and~\ref{seccion 6}), which means that the multiplication is determined by the commuting relations up to degree $n+1$.
The second case is treated in sections~\ref{seccion 7}, \ref{seccion 8} and~\ref{seccion familia} and the commutation relation is
$$
y^nx=dx^{n+1}-x^n y+(a+1)y^{n+1},
$$
where $(a+1)d=1$. We manage to describe
all the possible commutation relations up to $y^{3n+2}x$.
In this case the full classification is not achieved, due to the rapidly growing number of computations, which shows the limitations of our method.
 We manage to find a family of twisted tensor products which we call $B(a,L)$, parameterized by
$a\in K\setminus\{0,-1\}$ and $L\in\mathcal{L}$, where $\mathcal{L}$ is the set of quasi-balanced sequences of positive integers (see Definition~\ref{Def quasi balanced}). These sequences
are interesting on their own, for example they show a surprising connection to Euler's function $\varphi$. Every truncated quasi-balanced sequence can be continued in several ways, which
implies that all members of the family $B(a,L)$ have not the $m$-extension property for any $m$.

The following table contains all possible graded twisting maps of $K[x]$ with $K[y]$. The only twisting maps that have not been fully classified are in the last row.
For the families with $y x= x^2-xy+y^2$ we formulate the commuting relations
with respect to the infinite matrices $Y=\psi(y)$, $M=\psi(x)$ and $\mm=\psi(x-y)$, obtained from the faithful representation $\psi: K[x]\otimes_\sigma K[y]\to L(K[x]^{\mathds{N}_0})$. For example
the relation $y x= x^2-xy+y^2$ corresponds to $Y\mm=M \mm$, and $Y^k \mm=M^{k}\mm$ stands for $y^kx=x^{k+1}-x^ky+y^{k+1}$.

\noindent \begin{tabular}{|c|c|c|l|c|}
  \hline
  Commutation relations & Parameters & Reference & Observations \\ \hline
 $yx=bxy+cy^2$  & $b,c\in K$ &   Example~\ref{Ore} & Triangular. \\ \hline
 $yx=x^2+bxy+cy^2$  & $b,c\in K$ &   Theorem~\ref{clasificacion caso generico} & Quadratic. \\
   & $Q_k(b,c)\ne 0, \forall k\in\mathds{N}$ &  & \\ \hline
 $Y^k \mm=M^{k}\mm$, $\forall k\ge 1$  & ---- &   Proposition~\ref{caso particular} & No $m$-extension \\
 & &    &property for \\
  & &    &any $m$. \\ \hline
 $Y^k \mm=M^{k}\mm$, $\forall k<n$ & $a,d\in K$, $n\in\mathds{N}$  &   Theorem~\ref{anda} and & $n+1$-extension\\
 $Y^n \mm=dM^n \mm-a \mm Y^{n}$ & $R_k(a,d)\ne 0, \forall k\in\mathds{N}$ &   Corollary~\ref{Corolario anda} & property. \\  \hline
$Y^k \mm=M^{k}\mm$, $\forall k<n$ & $a\in K\setminus \{-1,0\}$&  Theorem~\ref{teorema familia BnL}  &  No $m$-extension \\
$Y^k \mm=d^r M^{k}\mm$,& $L\in\mathcal{L}$ & &  property  for \\
if $L_r< k<L_{r+1}$& &  & any $m$. \\
$Y^k \mm=d^r M^{k+1}-d^{r-1}M^j Y$&   &  & Subfamily of \\
$+a Y^{j+1}$,& &  & case below. \\
if  $k=L_r$& &    & \\ \hline
$Y^k \mm=M^{k}\mm$, $\forall k<n$ & Not fully &   Proposition~\ref{BnL 2n+1} and & Conjecture:\\
 $Y^n \mm=dM^{n+1}-M^nY$ & classified &   Proposition~\ref{BnL 2n} & No $m$-extension\\
$+a Y^{n+1}$& &    &property. \\ \hline
\end{tabular}
\section{Preliminaries}\label{preliminares}
Let $K$ be a field and let $A$ and $B$ be unitary $K$-algebras. A  twisted tensor product of $A$ with $B$ over $K$ is an algebra structure defined on $A\ot B$,
such that the canonical maps $i_A\colon A\longrightarrow  A\ot_K B$ and $i_B\colon B\longrightarrow A\ot_K B$ are algebra maps satisfying $a\ot b= i_A(a)i_B(b)$.
We will classify the graded twisted tensor products of $K[x]$ with $K[y]$. As is known (see e.g. \cite{CSV}) classifying the twisted
tensor products is equivalent to classifying the twisting maps $\tau: K[y]\otimes K[x]\to K[x]\otimes K[y]$. A linear map
$\tau: K[y]\otimes K[x]\to K[x]\otimes K[y]$ determines and is determined by linear maps $\gamma^r_j:K[x]\to K[x]$ for $r,j\in\mathds{N}_0$ such that $\gamma^r_j(a)=0$
for fixed $r,a$ and sufficiently big $j$; via the formula
$$
\tau(y^r\otimes a)=\sum_j \gamma^r_j(a)\otimes y^j.
$$
Moreover $\tau$ is a twisting map if and only if
\begin{enumerate}
  \item $\gamma^0_j=\delta_{j0}\ide$.
  \item $\gamma^r_j(1)=\delta_{jr}$.
  \item For all $r,j$ and all $a,b\in K[x]$,
  $$
  \gamma^r_j(ab)=\sum_{k=0}^{\infty}\gamma^r_k(a)\gamma^k_j(b).
  $$
  Note that for fixed $a,b\in K[x]$, the sum is finite.
  \item For all $r,j$ and $i<r$,
$$
\gamma^r_j=\sum_{l=0}^j\gamma^i_l\circ \gamma^{r-i}_{j-l}.
$$
\end{enumerate}
A straightforward computation shows that these four conditions correspond to the four conditions
\begin{enumerate}

\item[(a)] $s(1\otimes a)=a\otimes 1$,

\item[(b)] $s(y^r\ot 1)=1\ot y^r$,

\item[(c)]$s(y^r\otimes ab)=(\mu_A\otimes C)\xcirc (A\otimes s)\xcirc (s\otimes A) (y^r\otimes a\otimes b)$,

\item[(d)] $s(y^ry^t\otimes a)=(A\otimes\mu_C)\xcirc (s\otimes C)\xcirc (C\otimes s) (y^r\otimes y^t\otimes a)$,

\end{enumerate}

for all $a,b\in K[x]$ and all $r,t\in\mathds{N}$.

If $\tau$ is a twisting map, then we will define a representation of the twisted  tensor product $K[x]\otimes_\tau K[y]$ on
$K[x]^{\mathds{N}_0}$ along the lines of~\cite{GGV2}*{Theorem 1.10}. For this note that the elements of $L(K[x]^{\mathds{N}_0})$ are the infinite matrices with
entries in $K[x]$ indexed by $\mathds{N}_0\times \mathds{N}_0$ such that each row has only a finite number of non zero entries.
\begin{notation}
Along this paper we denote by $Y$ the infinite matrix
$$
Y:=\begin{pmatrix}
     0 & 1 & 0 & 0 & \dots \\
     0 & 0 & 1 & 0 &  \\
     0 & 0 & 0 & 1 &  \\
     \vdots &  &  &  & \ddots
   \end{pmatrix}\in L(K[x]^{\mathds{N}_0}).
$$
\end{notation}
\noindent For any infinite matrix $B$ we have $(Y^k B)_{ij}=B_{i+k,j}$ and $(B Y^k)_{i,j}=\begin{cases}
                                                        B_{i,j-k}, & \mbox{if } j\ge k \\
                                                        0, & \mbox{otherwise}.
                                                      \end{cases}$

\noindent If now $\tau: K[y]\otimes K[x]\to K[x]\otimes K[y]$ is a twisting map determined by the $K$-linear maps $\gamma^i_j$,  for each $a\in K[x]$ we define the infinite matrix
$M(a)\in  L(K[x]^{\mathds{N}_0})$ by $M(a)_{ij}=\gamma_j^i(a)$. This matrix satisfies the finiteness condition, since
$$
\tau(y^i\otimes a)=\sum_j \gamma^i_j(a)\otimes y^j\in K[x]\otimes K[y],
$$
so $\gamma_j^i(a)\ne 0$ only for a finite number of $j$'s.

\begin{remark} \label{conditions for M(a)}
By conditions~(2) and~(3) we have $M(1)=\ide$ and $M(ab)=M(a) M(b)$ for all $a,b\in K[x]$.
\end{remark}

\begin{proposition}\label{representation}
The formulas $\psi(a)=M(a)$ and $\psi(y)=Y$ define an injective algebra map (faithful representation) $\psi: K[x]\otimes_{\tau}K[y]\to L(K[x]^{\mathds{N}_0})$.
\end{proposition}

\begin{proof}
By Remark~\ref{conditions for M(a)} in order to prove that $\psi$ is an algebra map, we only have to check that
$$
\psi(y)\psi(a)=\sum_{u} \psi(\gamma_u^1(a))\psi(y^u)
$$
for all $a\in K[x]$. But
\begin{eqnarray*}
(\psi(y)\psi(a))_{ij}   &=&  (YM(a))_{ij}=\gamma_j^{i+1}(a)=\sum_{u=0}^{j}\gamma_{j-u}^{i}(\gamma_u^1(a))\\
   &=& \sum_{u=0}^j M(\gamma_u^1(a))_{i,j-u}=\sum_{u=0}^{\infty} (M(\gamma_u^1(a))Y^{u})_{ij}\\
 &=& \sum_{u} \left(\psi(\gamma_u^1(a))\psi(y^u) \right)_{ij},
\end{eqnarray*}
as desired.
The injectivity follows from the fact that the composition of $\psi$ with the surjection onto the first row gives the canonical linear isomorphism
$K[x]\otimes_{\tau}K[y]\to K[x]^{\oplus \mathds{N}_0}$.
\end{proof}

\begin{proposition}\label{condiciones para twisting}
  Let $M\in L(K[x]^{\mathds{N}_0})$ be such that $M_{0j}=x\delta_{0j}$ and

 \begin{equation}\label{condiciones twisting}
   Y^k M=\sum_{j\ge 0} M_{kj}(M) Y^j.
 \end{equation}

  (Note that the sum is finite and that if $M_{kj}=a_0+a_1 x+\dots +a_n x^n\in K[x]$, then
  $M_{kj}(M)=a_0 \ide+a_1 M+\dots +a_n M^n\in L(K[x]^{\mathds{N}_0})$).

  Then the maps $\gamma^r_j$ defined by $\gamma^r_j(x^i)\coloneqq (M^i)_{kj}\in K[x]$ determine a twisting map.
\end{proposition}

\begin{proof}
We will prove that $\gamma^r_j$ satisfies~(1) to~(4).

(1): This is clear since $(M^i)_{0j}=x^i \delta_{0j}$.

(2): Follows from $M^0=\ide$.

(3): Clearly
$$
  \gamma^r_j(x^{i+l})=(M^{i+l})_{rj}=\sum_{k=0}^{\infty}(M^{i})_{rk}(M^{l})_{kj}=\sum_{k=0}^{\infty}\gamma^r_k(x^i)\gamma^k_j(x^l),
$$
as desired.

(4): For all $i,j,k,l$ we have to prove
\begin{equation}\label{composition law}
\gamma^{l+k}_j(x^i)=\sum_{u=0}^{j} \gamma^l_u (\gamma^{k}_{j-u}(x^{i})
\end{equation}
 by induction in $k$. For $k=1$ we have
\begin{eqnarray*}
  \gamma^{l+k}_j(x) &=& M_{k+l,j} \\
   &=& (Y^k M)_{l,j}\\
   &=&\sum_{u\ge 0}(M_{k,u}(M) Y^u)_{l,j}\\
   &=&\sum_{u\ge 0}(M_{k,u}(M))_{l,j-u}\\
   &=&\sum_{u\ge 0}\gamma^{l}_{j-u}(M_{k,u})\\
   &=& \sum_{u=0}^j\gamma^{l}_{j-u}(\gamma^k_u(x))\\
   &=& \sum_{u=0}^{j} \gamma^l_u (\gamma^{k}_{j-u}(x))
\end{eqnarray*}
where the fifth equality follows from the fact that for $M_{i,l}(x)=\sum_s a_s x^s$ we have
$$
(M_{i,l}(M))_{rj}=\sum_s a_s(M^s)_{rj}=\sum_s a_s\gamma^r_j(x^s)= \gamma^r_j(\sum_s a_s x^s)=\gamma^r_j(M_{i,l}).
$$
Assume~\eqref{composition law} is valid for $i$. Then
\begin{eqnarray*}
  \gamma^{l+k}_j(x^{i+1}) &=& \sum_{r} \gamma^{l+k}_r(x^i)\gamma_{j}^{r}(x) \\
   &=& \sum_{r} \sum_{s=0}^r \gamma^l_s (\gamma^{k}_{r-s}(x^i)\gamma_{j}^{r}(x)\\
   &=&\sum_{s\ge 0} \sum_{n\ge 0} \gamma^l_s (\gamma^{k}_{n}(x^i)\gamma_{j}^{s+n}(x)\\
   &=&\sum_{n,s\ge 0} \gamma^l_s (\gamma^{k}_{n}(x^i)\sum_{u=0}^{j}\gamma_u^s(\gamma_{j-u}^{n}(x)\\
   &=&\sum_{n\ge 0}\sum_{u=0}^{j}\sum_{s\ge 0} \gamma^l_s (\gamma^{k}_{n}(x^i)\gamma_u^s(\gamma_{j-u}^{n}(x))\\
   &=&\sum_{n\ge 0}\sum_{u=0}^{j} \gamma^l_u (\gamma^{k}_{n}(x^i)\gamma_{j-u}^{n}(x))\\
   &=&\sum_{u=0}^{j} \gamma^l_u (\sum_{n\ge 0}\gamma^{k}_{n}(x^i)\gamma_{j-u}^{n}(x))\\
   &=&\sum_{u=0}^{j} \gamma^l_u (\gamma^{k}_{j-u}(x^{i+1})),
\end{eqnarray*}
as desired.
\end{proof}

Now we assume that the potential twisting map is graded, that means that $\tau(y^r\otimes x^i)=\sum_{j=0}^{i+r} a_j x^{i+r-j}\otimes y^j$, and so
the maps $\gamma^r_j$ are homogeneous of degree $r-j$.

\begin{corollary}\label{graded condition}
  Let $M\in L(K^{\mathds{N}_0})$ be such that $M_{0j}=\delta_{0j}$, $M_{kj}=0$ for $j>k+1$
  and

\begin{equation}\label{fundamental matrix equality}
  Y^k M=\sum_{j= 0}^{k+1} M_{kj}M^{k+1-j} Y^j.
\end{equation}
   Then the maps $\gamma^r_j$ defined by $\gamma^r_j(x^i)\coloneqq (M^i)_{kj}x^{k+i-j}$ determine a graded twisting map.
\end{corollary}
\begin{proof}
  The map $\tau$ determined by the $\gamma^r_j$ is clearly graded, so we only need to show that the matrix $\widetilde{M}$ defined by
  $\widetilde{M}_{kj}=M_{kj}x^{k+1-j}$ satisfies~\eqref{condiciones twisting}, since
  $\gamma^r_j(x^i)= (\widetilde{M}^i)_{kj}$ and $M_{0j}= x \delta_{0j}$. But
\begin{eqnarray*}
 (Y^k\widetilde{M})_{rs} &=& (Y^k M)_{rs} x^{r+k+1-s}= x^{r+k+1-s}\sum_{j=0}^{k+1} M_{kj}(M^{k+1-j}Y^j)_{r,s} \\
   &=&  x^{r+k+1-s} \sum_{j=0}^{k+1} M_{kj}(M^{k+1-j})_{r,s-j} \\
   &=& \sum_{j=0}^{k+1} \widetilde{M}_{kj}(\widetilde{M}^{k+1-j}Y^j)_{r,s}\\
  &=&\sum_{j=0}^{k+1}  (\widetilde{M}_{kj}(\widetilde{M})Y^j)_{r,s}\\
  &=&\sum_{j\ge 0}  (\widetilde{M}_{kj}(\widetilde{M})Y^j)_{r,s},
\end{eqnarray*}
and so the result follows from Proposition~\ref{condiciones para twisting}.
\end{proof}

\section{Construction of the matrices associated with a twisting map}

 A matrix satisfying the conditions of Corollary~\ref{graded condition} determines a graded twisting map, but it is also clear that
  a graded twisting map determines such a matrix $M$ (Note that $M_{kj}=0$ for $j>k+1$).
  So, in order to classify the graded twisting maps, we have to classify the matrices $M$ satisfying the conditions of Corollary~\ref{graded condition}. Note that
  $M=\psi(x)|_{x=1}=M(x)|_{x=1}$ in the notation of Proposition~\ref{representation}.
  We will write $M_{10}=a$, $M_{11}=b$ and $M_{12}=c$ for such a matrix. In some cases the values of $a$, $b$ and $c$ determine completely the matrix $M$
  (and hence the twisting map).

\begin{example}\label{Ore}
If $a=0$, then the only possible non zero entries of $M$ are $M_{n,n}$ and $M_{n,n+1}$. Set $b_n= M_{n,n}$ and $c_n= M_{n,n+1}$. From $YM=b MY+cY^2$ we obtain on one hand
  $$
  M_{n,n}=(YM)_{n-1,n}=b(MY)_{n-1,n}=b M_{n-1,n-1},
  $$
  so $b_n=b^n$. On the other hand we obtain
  $$
c_n=  M_{n,n+1}=(YM)_{n-1,n+1}=b(MY)_{n-1,n+1}+c (Y^2)_{n-1,n+1}=b M_{n-1,n}+c=b c_{n-1}+c.
  $$
  It follows that $c_n=nc$ if $b=1$ and that $c_n=c\frac{b^n-1}{b-1}$, if $b\ne 1$. The corresponding matrix is
$$
\begin{pmatrix}
  1 & 0 & 0 & 0 & 0 & \dots  \\
  0 & b & c & 0 & 0 &   \\
  0 & 0 & b^2 & c(b+1) & 0 &   \\
  0 & 0 & 0 & b^3 & c(b^2+b+1) &   \\
  \vdots & \vdots &  &  0 & b^4 & \ddots \\
  \vdots &  &  & \vdots &  0 & \ddots
\end{pmatrix},
$$
the twisting map is given by
\begin{align*}
  \tau(1\otimes x)& = x\otimes 1  ,\\
 \tau(y\otimes x) & = b x\otimes y+c(1\otimes y^2),\\
  \tau(y^2\otimes x) & = b^2 x\otimes y^2+c(b+1)(1\otimes y^3),\\
  \tau(y^3\otimes x) & = b^3 x\otimes y^3+c(b^2+b+1)(1\otimes y^4),\\
  &\vdots
\end{align*}
Using the inclusion $K[x]\hookrightarrow K[x]\otimes K[y]\cong_K K[x,y]$ and similarly $K[y]\hookrightarrow K[x,y]$
we can write
\begin{align*}
 y x & = b xy+c y^2,\\
  y^2 x & = b^2 x y^2+c(b+1) y^3,\\
  y^3 x & = b^3 x y^3+c(b^2+b+1)y^4,\\
  &\vdots
\end{align*}
and by Corollary~\ref{graded condition} the matrix equalities
\begin{align*}
 Y M & = b MY+c Y^2,\\
  Y^2 M & = b^2 M Y^2+c(b+1) Y^3,\\
  Y^3 M & = b^3 M Y^3+c(b^2+b+1)Y^4,\\
  &\vdots
\end{align*}
guarantee that $\tau$ is a twisting map. In fact the first equality implies all the others (use induction)
and can be seen to be true:
$$
\begin{pmatrix}
  0 & b & c & 0  &   \\
  0 & 0 & b^2 & c(b+1)  &   \\
   0 & 0 & 0 & b^3  &   \\
  \vdots & \vdots &  &  0  & \ddots \\
  \vdots &  &  & \vdots  & \ddots
\end{pmatrix}
=b \begin{pmatrix}
  0&1 & 0 & 0 & 0  & \dots  \\
  0 &0& b & c & 0  &   \\
  0 &0 &0 & b^2 & c(b+1)  &   \\
  \vdots && \vdots &  &  0  & \ddots \\
  \vdots &&  &  & \vdots  & \ddots
\end{pmatrix}
+ c\begin{pmatrix}
  0&0 & 1 & 0 & 0  & \dots  \\
  0 &0& 0 & 1 & 0  &   \\
  0 &0 &0 & 0 & 1  &   \\
  \vdots && \vdots &  &  0  & \ddots \\
  \vdots &&  &  & \vdots  & \ddots
\end{pmatrix}
$$
since
$$
YM=\begin{pmatrix}
  0 & b & c & 0 & 0 & \dots  \\
  0 & 0 & b^2 & c(b+1) & 0 &   \\
  0 & 0 & 0 & b^3 & c(b^2+b+1) &   \\
  \vdots & \vdots &  &  0 & b^4 & \ddots \\
  \vdots &  &  & \vdots &  0 & \ddots
\end{pmatrix}
$$
and
$$
MY=\begin{pmatrix}
  0 &1 & 0 & 0 & 0 & 0 & \dots  \\
  0 &0 & b & c & 0 & 0 &   \\
  0 &0 & 0 & b^2 & c(b+1) & 0 &   \\
  0 &0 & 0 & 0 & b^3 & c(b^2+b+1) &   \\
  \vdots & \vdots &  &0 &  0 & b^4 & \ddots \\
  \vdots &  &  & \vdots &0 &  0 & \ddots
\end{pmatrix}.
$$

\end{example}

\begin{lemma}\label{tecnico}
Let $A$ be an associative $K$-algebra, $k\ge 2$, $x,y\in A$, $M_{i,j}\in K$ for $0\le j<k$ and $0\le i\le j+1$ such that $M_{0j}=\delta_{j0}$, $M_{10}=1$ and
$$
y^j x=\sum_{i=0}^{j+1} M_{ji}x^{j+1-i}y^i, \quad\text{for $0\le j<k$.}
$$
Set $b\coloneqq M_{11}$ and $c\coloneqq M_{12}$. Then
\begin{equation}\label{induccion}
  (1-M_{k-1,k})y^k x=\sum_{s=0}^{k+1}\ov M_{k,s} x^{k+1-s} y^s,
\end{equation}
where
$$
\ov M_{k,0}=\sum_{i=0}^{k-1}M_{k-1,i}M_{i0},\quad \ov M_{k,k+1}=c+b M_{k-1,k}\quad\text{and}\quad
\ov M_{k,s}=bM_{k-1,s-1}+\sum_{i=s-1}^{k-1}M_{k-1,i}M_{is},
$$
for $s=1,\dots,k$.
\end{lemma}

\begin{proof}
  We have
  \begin{eqnarray*}
y^k x &=& y^{k-1}yx=y^{k-1}(x^2+bxy+cy^2) \\
     &=& \left(\sum_{i=0}^k M_{k-1,i} x^{k-i}y^i\right) x+ b \sum_{i=0}^k M_{k-1,i} x^{k-i}y^{i+1}+c y^{k+1}  \\
     &=& M_{k-1,k}y^k x+ \sum_{i=0}^{k-1} M_{k-1,i} x^{k-i}(y^i x)+ b \sum_{s=1}^k M_{k-1,s-1} x^{k+1-s}y^s+ (c+b M_{k-1,k})y^{k+1}.
  \end{eqnarray*}
Since
 \begin{eqnarray*}
 \sum_{i=0}^{k-1} M_{k-1,i} x^{k-i}(y^i x) &=&\sum_{i=0}^{k-1} M_{k-1,i} x^{k-i}\left(\sum_{s=0}^{i+1} M_{is}x^{i+1-s}y^s\right) \\
     &=&\sum_{i=0}^{k-1}\sum_{s=1}^{i+1} M_{k-1,i} M_{is}x^{k+1-s}y^s +\sum_{i=0}^{k-1} M_{k-1,i} M_{i,0} x^{k+1} \\
     &=&\sum_{s=1}^{k} \left(\sum_{i=s-1}^{k-1} M_{k-1,i} M_{is}\right) x^{k+1-s}y^s +\sum_{i=0}^{k-1} M_{k-1,i} M_{i,0} x^{k+1},
  \end{eqnarray*}
  the result follows.
\end{proof}

  \begin{remark}\label{a distinto de cero}
  Given a twisting map $\tau$ such that $a\ne 0$,
  we can replace $\tau$ by the isomorphic twisting map
  $\tau'=(f^{-1}\otimes \ide)\circ \tau \circ (\ide\otimes f)$ where $f(x)=ax$. Then for $\tau'$ we have $a'=1$, $b'=b$ and $c'=ca$.
  So we can and will assume that $a=1$.
\end{remark}

\begin{proposition}\label{bc determinan M}
Assume $M$ determines a graded twisting map.
Assume $a=1$ and $M_{k,k+1}\ne 1$ for all $k\ge 1$. Then $b$ and $c$ determine uniquely the matrix $M$ (and hence the twisting map).
\end{proposition}
\begin{proof}
  Lemma~\ref{tecnico} shows that in that case the entries $M_{j,i}$ with $j<k$ determine uniquely the entries $M_{k,i}$, hence, by induction,
   the entries $M_{1,j}$, i.e.,  $M_{10}=1$, $M_{1,1}=b$, and $M_{12}=c$, determine the whole matrix.
\end{proof}

However not every choice of $b$ and $c$ is valid. Let $M$ be a matrix of a twisting map and set $b_n=M_{n,n}$ and $c_n=M_{n,n+1}$.

\begin{lemma}\label{lema clasifica}
\begin{equation}\label{formula para c}
  c_{n+1}(1-c_n)=b c_n+c,\quad\text{for all $n$.}
\end{equation}
Moreover, if $c\ne 1$, then $c_n\ne 1$ for all $n$, and if $c=1$, then $b=-1$ and $(1-c_n)(1-c_{n+1})=0$ for all $n$.
\end{lemma}
\begin{proof}
  We have
  $$
  (YM)_{n,n+2}=M_{n+1,n+2},\quad (MY)_{n,n+2}=M_{n,n+1},\quad (Y^2)_{n,n+2}=1
  $$
  and
  $$
   (M^2)_{n,n+2}=\sum_k M_{n,k}M_{k,n+2}=M_{n,n+1}M_{n+1,n+2},
  $$
  since $M_{n,k}=0$ for $k>n+1$ and $M_{k,n+2}=0$ for $k<n+1$.
  Hence, from
  $$
  YM=M^2+b MY+c Y^2
  $$
  we obtain $c_{n+1}=c_n c_{n+1}+b c_n +c$, from which~\eqref{formula para c} follows.

  Assume that $c\ne 1$ and assume by contradiction
  that $c_n=1$ for some $n>1$. Then from~\eqref{formula para c} for $n$ we obtain $0=b c_n+c$ and so $b=-c$, hence~\eqref{formula para c} now reads
  $(1-c_k)(c-c_{k+1})=0$. For $k=1$ this yields $c_2=c$, for $k=2$ we obtain $c_3=c$ and so inductively we obtain $c_k=c$ for all $k>1$ and so $c_n=c\ne 1$,
  which is the desired contradiction.

  Finally, assume that $c=1$, then from~\eqref{formula para c} for $n=1$ we obtain $b=-1$ and so~\eqref{formula para c} reads $c_{n+1}(1-c_n)=-c_n+1$,
  hence $(1-c_n)(1-c_{n+1})=0$, as desired.
\end{proof}

If $c\ne 1$, then not all values of $b$ and $c$ yield twisting maps. For example, if $c\ne 1$ and $1-c=c(b+1)$, then by~\eqref{formula para c}
we would have $c_2=\frac{c(b+1)}{1-c}=1$, which is impossible by the previous lemma.

When $c\ne 1$, the first formulas for $c_n$ are
$$
c_2=\frac{c(b+1)}{1-c},\quad c_3=\frac{c(1+b+b^2-c)}{1-2c-bc},\quad c_4=\frac{c(1+b)(1+b^2-2c)}{1-(3+2b+b^2)+c^2},
$$
and in general we have
$$
c_n=\frac{cP_n}{Q_n},
$$
where $P_n$ and $Q_n$ are polynomials in $b$ and $c$. Moreover, the formula~\eqref{formula para c} yields the
recursive rules
\begin{equation}\label{recursion}
P_{n+1}=b P_n+Q_n\quad\text{and}\quad Q_{n+1}=Q_n-cP_n.
\end{equation}

Given $b$ and $c$, these values are defined even when some $c_n=1$, and that happens if and only if $Q_{n+1}=Q_{n+1}(b,c)=0$.

\begin{lemma}\label{primera fila de M}
Let the first row of $M\in L(K[x]^{\mathds{N}_0})$ be given by $M_{0*}=E_0=(1,0,0,0,\dots)$. If $M$ satisfies
$$
Y^k M=\sum_{i=0}^{k+1} a_i M^{k+1-i}Y^i,
$$
then $M_{kj}=a_j$ for $j=0,\dots, k+1$.
\end{lemma}

\begin{proof}
Note that $(M^r)_{0,*}=E_0$ for all $r$, and so $(M^rY^{i})_{0j}=M_{0,j-i}=\delta_{ij}$.
Hence
$$
M_{kj} = (Y^k M)_{0j}=\sum_{i=0}^{k+1} a_i (M^{k+1-i}Y^i)_{0j} = \sum_{i=0}^{k+1} a_i \delta_{ij} = a_j,
$$
as desired.
\end{proof}

\begin{theorem} \label{clasificacion caso generico}
Let $K$ be a field and let $b,c\in K$ with $c\ne 1$. Then $b$ and $c$ determine a unique twisting map via Proposition~\ref{bc determinan M}
if and only if $Q_n(b,c)\ne 0$ for all $n\in\mathds{N}$, where the polynomials $P_n,Q_n\in K[b,c]$ are defined by $P_n=1$,
$Q_n=1$ and the recursive rules~\eqref{recursion}.
\end{theorem}
\begin{proof}
By the discussion above, if the twisting map $\tau$ is determined by $b$ and $c$, then $Q_n(b,c)\ne 0$ for all $n\in\mathds{N}$.
Assume now that we have $b$ and $c$ such that $Q_n(b,c)\ne 0$ for all $n\in\mathds{N}$. We will first construct a matrix $M\in L(K[x]^{\mathds{N}_0})$
satisfying
\begin{equation}\label{ecuacion en grado 2 para M}
  YM=M^2+bMY+cY^2.
\end{equation}

For this consider a grading on the elementary matrices $E_{ij}\in L(K^{\mathds{N}_0})$ given by $deg(E_{ij})=i-j$. Then $M=\sum_{j=-1}^{+\infty} M_j$ and the matrix
multiplication is compatible with this decomposition. Notice that the diagonal matrices form a subalgebra isomorphic to $\prod_{\mathds{N_0}} K$.
 Consider the matrices $Y$ and $Z$ given by $Y_{ij}=\delta_{i+1,j}$ and $Z_{ij}=\delta_{i,j+1}$.
Then $M_{-1}=CY$, where $C$ is the diagonal matrix given by $C_{ii}=c_i$. Set also $B^{(0)}=M_0$ and there are elements $B^{(j)}\in R_0$ such that
$M_j=Z^j B^{(j)}$. Let $S:R_0\to R_0$ be the shift given by $(SC)_j=C_{j+1}$ and $T:R_0\to R_0$ the right inverse of $S$, that is $(TC)_j=C_{j-1}$ and
$(TC)_0=0$.
Then
$$
YC=(SC) Y,\quad CZ=Z(SC),\quad ST=\ide,\quad ZCY=TC,\quad YZ=\ide.
$$
We can write
$$
M=CY+B^{(0)}+\sum_{j\ge 1}Z^j B^{(j)},
$$
where $C,B^{(j)}$ have degree 0 (they are diagonal matrices), $Y$ has degree $-1$, and $Z$ has degree 1.

Then the equality~\eqref{ecuacion en grado 2 para M}
is true if and only if it holds in each degree, i.e. if
\begin{equation}\label{ecuacion graduada}
(YM)_{k}=(M^2+b MY+cY^2)_k
\end{equation}
for all $k\ge -2$.

In the rest of the proof we will construct recursively $M_{-1}$, $M_{0}$, $M_{1}$, $M_2$,\dots, $M_j$, such that~\eqref{ecuacion graduada}
holds for $k=-2,-1,,0,1,\dots,j-1$. This yields an inductive construction of  the unique $M$ such that~\eqref{ecuacion en grado 2 para M} holds.

Note that
$$
(YM)_{-2}=YCY=(SC)Y^2,\quad (YM)_{-1}=YB^{(0)}=(SB^{(0)})Y,\quad \text{and}\quad (YM)_{j}=Z^{j}B^{(j+1)}
$$
for $j\ge 0$.
Note also that
$$
(MY)_{-2}=CY^2,\quad (MY)_{-1}=B^{(0)}Y,\quad \text{and}\quad (MY)_{j}=Z^{j+1}B^{(j+1)}Y=Z^j (TB^{(j+1)})
$$
for $j\ge 0$.

Finally,
$$
(M^2)_{-2}=CYCY=C(SC)Y^2,\quad (M^2)_{-1}=(CY)B^{(0)}+B^{(0)}CY= C(SB^{(0)})Y+B^{(0)}CY,
$$
and
\begin{eqnarray*}
 (M^2)_{j}&=&CY Z^{j+1}B^{(j+1)}+Z^{j+1}B^{(j+1)}CY+ \sum_{i=0}^{j} Z^i B^{(i)}Z^{j-i}B^{(j-i)}\\
 &=&  Z^{j}(S^j C)B^{(j+1)}+Z^{j} T(B^{(j+1)}C)+ Z^{j}\sum_{i=0}^{j} (S^{j-i} B^{(i)}) B^{(j-i)}
\end{eqnarray*}
for $j\ge 0$.

For $k=-2$ the equality~\eqref{ecuacion graduada} reads
$$
(SC)Y^2=C(SC)Y^2+bC Y^2+c Y^2,
$$
and since multiplying by $Y$ on the right is injective, we have
$$
(SC)=C(SC)+bC+c \mathds{1},
$$
Hence $(\mathds{1}-C)SC=bC+c\mathds{1}$ which is equality~\eqref{formula para c}. This proves that $b$ and $c$ determine
$C=M_{-1}$ such that~\eqref{ecuacion graduada} holds for $k=-2$ and the condition $Q_n(b,c)\ne 0$ ensures that $M_{n,n+1}\ne 0$ for all $n$.

For $k=-1$ the equality~\eqref{ecuacion graduada} reads
$$
(SB^{(0)})Y=C(SB^{(0)})Y+B^{(0)}CY+bB^{(0)}Y,
$$
and since multiplying by $Y$ on the right is injective, we have
$$
(SB^{(0)})=C(SB^{(0)})+B^{(0)}C+bB^{(0)}.
$$
So we have a recursive formula for $B^{(0)}$:
$$
(B^{(0)})_{n+1}(1-c_n)=(B^{(0)})_n(c_n+b).
$$
Since $(1-c_n)\ne 0$ and we already have $B^{(0)}_0=1$ and $B^{(0)}_1=b$, this formula determines a unique $B^{(0)}$ such that the
equality~\eqref{ecuacion graduada} in degree -1 is satisfied.

For $j\ge 0$ the equality~\eqref{ecuacion graduada} reads
$$
Z^{j}B^{(j+1)} =  Z^{j}(S^j C)B^{(j+1)}+Z^{j} T(B^{(j+1)}C)+ Z^{j}\sum_{i=0}^{j} (S^{j-i} B^{(i)}) B^{(j-i)}+bZ^j (TB^{(j+1)}),
$$
and since multiplication by $Z^j$ at the left is injective we have
$$
(\mathds{1} -  (S^j C))B^{(j+1)}=T(B^{(j+1)})(TC+b\mathds{1})+ \sum_{i=0}^{j} (S^{j-i} B^{(i)}) B^{(j-i)}.
$$
Assume we have constructed inductively $C$ and $B^{(i)}$ for $i=0,\dots,j$ such that~\eqref{ecuacion graduada} is satisfied for
$k=-2,\dots, j-1$. Then set $R:=\sum_{i=0}^{j} (S^{j-i} B^{(i)}) B^{(j-i)}$, which depends only on $B^{(i)}$ for $i=0,\dots,j$,
and we obtain a recursive formula
$$
B^{(j+1)}_{n}(1-c_{n+j})=B^{(j+1)}_{n-1}(c_{n-1}+b)+R_n,
$$
which yields a unique $B^{(j+1)}$ such that~\eqref{ecuacion graduada} is satisfied for
$k=-2,\dots, j$. Note that the formula is valid for $n=0$ setting $B^{(j+1)}_{-1}=c_{-1}=0$.

This proves that there is a unique
$$
M=CY+B^{(0)}+\sum_{j\ge 1}Z^j B^{(j)},
$$
satisfying~\eqref{ecuacion en grado 2 para M}.

It only remains to prove that $M$ satisfies~\eqref{condiciones twisting} for all $k$. For $k=0$ this is clear, and
from Lemma~\eqref{primera fila de M} we obtain $M_{1*}=E_0+bE_1+cE_2$, so~\eqref{condiciones twisting} holds for $k=1$. Assume by induction hypothesis
that~\eqref{condiciones twisting} holds for $k<k_0$. Then Lemma~\ref{tecnico} and the fact that $M_{k_0,k_0+1}\ne 1$ yield
$$
Y^{k_0} M=\sum_{k=0}^{k_0+1}\frac{\overline{M}_{k_0,s}}{1-M_{k_0,k_0+1}} M^{k_0+1-s}Y^s.
$$
But then, by Lemma~\eqref{primera fila de M} we have $\frac{\overline{M}_{k_0,s}}{1-M_{k_0,k_0+1}}=M_{k_0,s}$ for $s=0,\dots,k_0+1$,
which yields~\eqref{condiciones twisting} for $k=k_0$ and completes the inductive step. Finally,
Corollary~\ref{graded condition} yields the desired twisting map, which is unique by Proposition~\ref{bc determinan M}.
\end{proof}

\section{Roots of $Q_n$}

In view of Theorem~\ref{clasificacion caso generico}, we want to analyze the polynomials $Q_n$ and their roots.
In particular we are interested in the following question: Given a pair $(b,c)\in K^2$, does there exists an $n\in\mathds{N}$ such that $Q_n(b,c)=0$?
If the answer is no, then $(b,c)$ defines a unique twisting map via the previous theorem. Else, if $(b,c)\ne (-1,1)$,
there is no twisting map for that $(b,c)$.

For a fixed pair $(b,c)$ we can write the recursive relations~\eqref{recursion} in matrix form:
$$
\binom{P_n(b,c)}{Q_n(b,c)}=\begin{pmatrix}b&1\\ -c &1 \end{pmatrix}^n \binom{1}{1}.
$$
If the eigenvalues of $D:=\begin{pmatrix}b&1\\ -c &1 \end{pmatrix}$ are different, then
 there exists an invertible matrix $T$ such that
$$
D= T \begin{pmatrix}\lambda_1&0\\ 0 &\lambda_2 \end{pmatrix} T^{-1},
$$
and so
$$
Q_n=r_1 \lambda_1^n+r_2 \lambda_2^n
$$
for some $r_1,r_2\in K$. If $r_1,\lambda_2\ne 0$ then $Q_n=0$ if and only if
\begin{equation}\label{chequeo}
\left(\frac{\lambda_1}{\lambda_2}\right)^n=-\frac {r_2}{r_1}.
\end{equation}

This condition is easier to verify than the infinite number of evaluations $Q_n(b,c)$.
 For example, if $K\subset \mathds{C}$, and $| \frac {r_1}{r_2}|\ne 1$, one can check the equality $Q_n=0$
 using real logarithms on the modulus in order to find the (unique) possible $n$, and then verifying the equality~\eqref{chequeo} for that $n$.

The eigenvalues of $D$ are
$$
\lambda_{1,2}=\frac{1}{2} \left(b+1\pm\sqrt{(b-1)^2-4 c}\right),
$$
and from $Q_0=1=r_1+r_2$ and $Q_1=1=r_1\lambda_1 +r_2\lambda_2$ we obtain
$$
r_1=\frac{1-\lambda_2}{\lambda_1-\lambda_2}\quad\text{and}\quad r_2=\frac{1-\lambda_1}{\lambda_2-\lambda_1}.
$$

If
\begin{equation}\label{casos}
  0\notin\{\lambda_1,\lambda_2,1-\lambda_1,1-\lambda_2,\lambda_1-\lambda_2\},
\end{equation}
then $Q_n=0$ if and only if
$$
\left(\frac{\lambda_1}{\lambda_2}\right)^n=\frac{1-\lambda_1}{1-\lambda_2}.
$$

Note that if $b,c\in\mathds{R}$, then $4c<(b-1)^2$ implies $|\frac {r_1}{r_2}|\ne 1$, and so in this case it
can be determined if $Q_n=0$ for some $n$.

Now we give a detailed account of each exceptional case in~\eqref{casos}:

If the eigenvalues coincide ($\lambda_1-\lambda_2=0$) then $c=\frac{(b-1)^2}{4}$.
In that case $\lambda=\lambda_1=\lambda_2=\frac{b+1}{2}\ne 0$, since $\lambda=0$ leads to $c=1$ and we also have
$$
Q_{n+1}=(n+1-n\lambda)\lambda^n.
$$
Hence $Q_{n+1}=0$ if and only if  $\lambda=\frac{n+1}{n}$ if and only if $b=1+\frac 2n$.

If one of the values $\lambda_1,\lambda_2$ is zero, then $\det(D)=b+c=0$. In that case~\eqref{formula para c} yields $c_n=c\ne 1$ for all $n$.

Note that $(1-\lambda_1)(1-\lambda_2)=c$,
and so, if $1-\lambda_1=0$ or $1-\lambda_2=0$, then $c=0$, and in that case $c_n=0\ne 1$ for all $n$.

This covers all cases. However there are some other interesting cases.

For example if we require $b=0$, then we recover the polynomials $S_n$ in~\cite{CG} via the equality $S_n(c)=Q_{n-1}(0,c)$. Even in this case,
our approach via matrices is new.

Another exceptional case happens when $\lambda_1=-\lambda_2$. In that case $b=-1$, and then
$$
c_n=\left\{ \begin{array}{rr} c&\text{if $n$ is odd}\\ 0 &\text{if $n$ is even.}\end{array}\right.
$$

\section{The case $yx=x^2-xy+y^2$}

In this section we assume that $\sigma$ is a twisting map and that $Y$ and $M$ are as in Corollary~\ref{graded condition}.
As before we write $M_{1,*}=(1,b,c,0,\dots)$ and assume that $(b,c)=(-1,1)$, which is the only case not covered
by Theorem~\ref{clasificacion caso generico}. This means that we are dealing with the commutation rule
$$
yx=x^2-xy+y^2.
$$
By Corollary~\ref{graded condition} we have
$$
YM=M^2-MY+Y^2,
$$
which implies $\mm^2=0$, where $\mm=M-Y$. The matrix $\widetilde{M}:= M-Y=\psi(x-y)\in L(K^{\mathds{N}_0})$
plays a central role in the classification of all the twisting maps with $(b,c)=(-1,1)$.
Note that
$$
\widetilde{M}_{0j}=\begin{cases} 1& j=0\\ -1 & j=1\\ 0& j>1 \end{cases}
$$
and that $\widetilde{M}_{1*}=\widetilde{M}_{0*}$.

\begin{lemma}\label{mixtos}
Let $d\ne 0$. Then
\begin{enumerate}
\item $\mm_{k*}=\mm_{k-1,*}$ if and only if $\mm Y^{k-1}\mm = 0$.
  \item $\mm_{k*}=d \mm_{k-1,*}$ if and only if $\mm Y^{k-1}\mm = \frac{1-d}d Y^k \mm$.
  \item $\mm_{k*}=d \mm_{k-2,*}$ if and only if $\mm Y^{k-1}\mm +Y \mm Y^{k-2}\mm = \frac{1-d}d Y^k \mm$.
\end{enumerate}
\end{lemma}

\begin{proof}
We only prove~(2) and~(3), since~(1) follows from~(2) with $d=1$. From
$$
Y^{k-1}\mm=\sum_{j=0}^k \mm_{k-1,j}M^{k-j}Y^j\quad\text{and}\quad  Y^{k}\mm=\sum_{j=0}^{k+1} \mm_{k,j}M^{k+1-j}Y^j
$$
we obtain that $\mm_{k*}=d \mm_{k-1,*}$ if and only if $Y^{k}\mm=d M Y^{k-1}\mm=d(\mm+Y)Y^{k-1}\mm$ if and only if $(1-d)Y^k\mm=d \mm Y^{k-1}\mm$.

Similarly $\mm_{k*}=d \mm_{k-2,*}$ if and only if $Y^{k}\mm=d M^2 Y^{k-2}\mm=d(\mm Y+Y\mm +Y^2)Y^{k-2}\mm$ if and only if
$(1-d)Y^k\mm=d \mm Y^{k-1}\mm + d Y \mm Y^{k-2}\mm$, as desired.
\end{proof}

\begin{lemma}\label{mixtos 2}
Let $n\in\mathds{N}$ with $n\ge 2$. Then $\widetilde{M}_{k*}=\widetilde{M}_{0*}$ for $0< k< n$ if and only if
$\mm Y^{k}\mm=0$ for $0\le k\le n-2$. Moreover, in this case
$$
M^{k+1}=Y^{k+1}+\sum_{j=0}^k Y^j \mm Y^{k-j}\quad\text{for $0\le k \le n-1$}
$$
and
$$
M^{n+1}=Y^{n+1}+\mm Y^{n-1}\mm + \sum_{j=0}^n Y^j \mm Y^{n-j}.
$$
\end{lemma}

\begin{proof}
The first assertion follows directly from Lemma~\ref{mixtos}(1). In that case, expand $M^{k+1}=(\mm+Y)^{k+1}$. If $k<n$, no
term in the expansion can have two times the factor $\mm$, and in the expansion of
$M^{n+1}=(\mm+Y)^{n+1}$, the only term with two times the factor $\mm$ is $\mm Y^{n-1}\mm$.
\end{proof}

\begin{proposition}\label{caso particular}
  There exists a twisting map such that $\widetilde{M}_{k*}=\widetilde{M}_{0*}$ for all $k\in \mathds{N}$.
\end{proposition}
\begin{proof}
Consider the matrix $\mm$ such that for all $j$,  $\mm_{j,0}=1$, $\mm_{j,1}=-1$ and $\mm_{j,i}=0$ for $i>1$.
We will show that $M=\mm+Y$ satisfies the conditions of Corollary~\ref{graded condition}. Clearly $M_{0j}=\delta_{0j}$ and $M_{kj}=0$ for $j>k+1$. So
we have to prove that for all $k$
$$
  Y^k M=\sum_{j= 0}^{k+1} M_{kj}M^{k+1-j} Y^j.
$$
In our case this reads
$$
Y^k M=M^{k+1}-M^k Y+Y^{k+1}
$$
and so, in terms of $\mm$, we have to prove
\begin{equation}\label{igualdad en caso particular}
  Y^k \mm=M^k \mm.
\end{equation}
But clearly $Y^k\mm=\mm$ for all $k$, since the columns are constant. So we have to prove that $M^k\mm=\mm$. For $k=1$ we have
$$
M\mm=(\mm+Y)\mm=Y\mm=\mm,
$$
since $\mm^2=0$. Assume by induction that $M^k\mm=\mm$. Then $M^{k+1}\mm=M^k (M\mm) =M^k \mm=\mm$, which completes the inductive step and thus proves\eqref{igualdad en caso particular},
finishing the proof of the proposition.
\end{proof}

\begin{proposition}
  Let $n\in\mathds{N}$ with $n\ge 2$ and assume that $\widetilde{M}_{k*}=\widetilde{M}_{0*}$ for $1< k< n$ and
  that $\widetilde{M}_{n,*}\ne \widetilde{M}_{0*}$. Then $\widetilde{M}_{n,j}=0$ for $1<j<n$. Moreover, if one sets
  $m_i:=\widetilde{M}_{n,i}$ then
\begin{equation}\label{eq38}
(1-m_0)Y^n \mm=m_0 \mm Y^{n-1}\mm+(m_0+m_1)\sum_{j=0}^{n-1}Y^j \mm Y^{n-j}+m_n \mm Y^n+(m_0+m_1+m_n+m_{n+1})Y^{n+1}
\end{equation}
and
\begin{equation}\label{primera ecuacion}
(m_{n+1}+1)(m_0+m_1)+m_n+m_{n+1}=0.
\end{equation}
\end{proposition}

\begin{proof}
Assume first that $m_{n+1}=\mm_{n,n+1}=0$. We first prove that $\mm_{n,j}=0$ for $n\ge j>1$. Clearly $0=(\mm^2)_{n,n}=(\mm_{n,n})^2$, so
$\mm_{n,n}=0$. Now assume that $2<k\le n$ and that $\mm_{n,j}=0$ for $j\ge k$. Then $0\le n-k+1\le n-2$ and so by Lemma~\ref{mixtos 2}
we have $\mm Y^{n-k+1}\mm=0$. But then $0=(\mm Y^{n-k+1}\mm)_{k-1,k-1}=(\mm_{n,k-1})^2$, hence $\mm_{n,k-1}=0$. Thus inductively we obtain
$\mm_{n,j}=0$ for $n\ge j>1$. From $(\mm^2)_{n,0}=0$ it follows that $m_0+m_1=0$, so~\eqref{eq38} reads $(1-m_0)Y^n \mm =m_0 \mm Y^{n-1}\mm$, which is satisfied by Lemma~\ref{mixtos}(2),
and~\eqref{primera ecuacion} is also trivially satisfied in this case.

Now we can assume that $m_{n+1}\ne 0$ and we will express the equality
$$
Y^n\mm=\sum_{k=0}^{n+1} m_{k} M^{n+1-k}Y^k
$$
in terms of $Y$ and~$\mm$.
By Lemma~\ref{mixtos 2} we have
$$
M^{n+1-k}Y^k=Y^{n+1}+\sum_{j=0}^{n-k} Y^j\mm Y^{n-j}\quad\text{for $k=1,\dots,n$}
$$
 and for $k=0$ we have
$$
M^{n+1}=\mm Y^{n-1}\mm+Y^{n+1}+\sum_{j=0}^{n} Y^j\mm Y^{n-j}.
$$
It follows that
$$
Y^n\mm=m_0 \mm Y^{n-1}\mm +\sum_{k=0}^{n+1} m_{k}Y^{n+1}+ \sum_{k=0}^{n} m_{k} \sum_{j=0}^{n-k} Y^j\mm Y^{n-j},
$$
and so we obtain
\begin{equation}\label{igualdad en nivel n}
Y^n\mm=m_0 \mm Y^{n-1}\mm +\sum_{k=0}^{n+1} m_{k}Y^{n+1}+ \sum_{j=0}^{n} \left( \sum_{k=0}^{n-j}m_{k}\right) Y^j\mm Y^{n-j}.
\end{equation}
We will evaluate the matrix equality~\eqref{igualdad en nivel n} at the entries $(i,i+n+1)$ for $i=1,\dots,n-1$.

First we claim that $(\mm Y^{n-1}\mm)_{i,i+n+1}=0$ for $i=1,\dots,n-1$. In fact,
$$
(\mm Y^{n-1}\mm)_{i,i+n+1}=\mm_{i,*}\cdot (Y^{n-1}\mm)_{*,i+n+1}=(1,-1,0,\dots,0,\dots)\cdot (\mm_{n-1,i+n+1},\mm_{n,i+n+1},\dots).
$$
But, since $\mm_{j,k}=0$ if $k>j+1$, we also have $\mm_{n-1,i+n+1}=0=\mm_{n,i+n+1}$, which proves the claim.

Clearly $(Y^{n+1})_{i,i+n+1}=1$, so it remains to compute $( Y^j\mm Y^{n-j})_{i,i+n+1}=\mm_{i+j,i+j+1}$.
Now we assert that

\begin{equation}\label{primera diagonal}
\mm_{i+j,i+j+1}=m_{n+1}\delta_{j,n-i}.
\end{equation}

In fact, since $0<i\le n-1$ and $0\le j\le n$, we have $i+j>0$, and so, for $1\le i+j\le n$, we know that~\eqref{primera diagonal}
holds. So it suffices to prove that
\begin{equation}\label{diagonal se anula}
  \mm_{n+k,n+k+1}=0\quad\text {for $1\le k\le n-1$}
\end{equation}
But
$$
0=(\mm Y^{k-1}\mm)_{n,n+k+1}=\mm_{n,n+1}\mm_{n+k,n+k+1}=m_{n+1} \mm_{n+k,n+k+1},
$$
and so, since $m_{n+1}\ne 0$, we obtain\eqref{diagonal se anula}, which proves~\eqref{primera diagonal}.

Finally note that by~\eqref{diagonal se anula} we have
$$
(Y^{n}\mm)_{i,i+n+1}=\mm_{i+n,i+n+1}=0\quad\text{for $i=1,\dots,n-1$.}
$$
Gathering the entries at $(i,i+n+1)$ for all the terms of~\eqref{igualdad en nivel n}
we obtain
$$
0=\sum_{k=0}^{n+1} m_{k}+\sum_{j=0}^{n} \left( \sum_{k=0}^{n-j}m_{k}\right)m_{n+1}\delta_{j,n-i}=
\sum_{k=0}^{n+1} m_{k}+ m_{n+1} \sum_{k=0}^{i}m_{k}\quad\text{for $i=1,\dots,n-1$.}
$$
Subtracting these equalities for consecutive values of $i$ yields $m_{n+1}m_j=0$ for $j=2,\dots,n-1$, hence  $\widetilde{M}_{n,j}=m_j=0$ for $1<j<n$.
From the case $i=1$ we obtain $\sum_{k=0}^{n+1} m_{k}+ m_{n+1}(m_0+m_1)=0$, which gives~\eqref{primera ecuacion}.
Finally, using $m_j=0$ for $1<j<n$ the equality~\eqref{eq38} follows directly from~\eqref{igualdad en nivel n}.
\end{proof}

\begin{proposition}\label{clasificacion}
  Let $n\in\mathds{N}$ with $n\ge 2$ and assume that $\widetilde{M}_{k*}=\widetilde{M}_{0*}$ for $1< k< n$ and
  that $\widetilde{M}_{n,*}\ne \widetilde{M}_{0*}$. Rename the only possibly non zero entries
  $$
  a:=m_{n+1}=\widetilde{M}_{n,n+1},\quad b:=m_n=\widetilde{M}_{n,n},\quad c:=m_1=\widetilde{M}_{n,1}\quad\text{and}\quad d:=m_0=\widetilde{M}_{n,0}.
  $$
  Then either
  \begin{enumerate}
    \item $(d,c,b,a)=(d,-d,-a,a)$ with $(d,a)\ne (1,0)$ or
    \item $(d,c,b,a)=(d,-1,0,a)$ with $a\ne 0$ and $d(a+1)=1$.
  \end{enumerate}
\end{proposition}

\begin{proof}
We will prove the following four assertions:
\begin{enumerate}
  \item[i)] If $a=0$, then $b=0$ and $c=-d$.
  \item[ii)] If $a\ne 0$ and $d=1$, then $b=-a$ and $c=-1$.
  \item[iii)] If $a\ne 0$, $d\ne 1$ and $b\ne 0$,  then $b=-a$ and $c=-d$.
  \item[iv)]  If $a\ne 0$, $d\ne 1$ and $b = 0$,  then $c=-1$ and $d(a+1)=1$.
\end{enumerate}
Note that in item~i) we have $(a,d)\ne (0,1)$, since $\mm_{n*}\ne \mm_{0*}$.
On one hand~i), ii) and~iii) imply condition~(1) and on the other hand~iv) implies condition~(2). Since items~i)--iv) cover all possible cases,
it suffices to prove these items in order to show that one of the conditions~(1) or~(2) necessarily holds.

\medskip

i): If $\mm_{n,n+1}=0$, then $0=(\mm^2)_{nn}=(\mm_{nn})^2$, so $b=\mm_{nn}=0$. Now
$$
0=(\mm^2)_{n0}=\mm_{n0}+\mm_{n1}=c+d
$$
 yields $c=-d$.\par

ii): If $a\ne 0$ and $d=1$, then the matrix equality~\eqref{eq38} at the entry $(1,2)$ yields
$$
0=(\mm Y^{n-1}\mm)_{1,2}+(1+c)((Y^{n-2}\mm Y^2)_{1,2}+(Y^{n-1}\mm Y)_{1,2}) + b(\mm Y^{n})_{1,2},
$$
since for any matrix $C$ we have $(C Y^3)_{1,2}=0$. So
$$
0=(1,-1,0,\dots)\cdot(\mm_{n-1,2},\mm_{n,2},*,*,\dots)+(1+c)(\mm_{n-1,0}+\mm_{n,1}) + b(\mm Y^n)_{1,2}.
$$
If $n=2$, this gives $0=-b+(1+c)(1+c)+b\mm_{10}=(1+c)^2$ and if $n>2$ this yields directly $0=(1+c)^2$.

So $c=-1$ and then~\eqref{eq38} reads
$$
0=\mm Y^{n-1}\mm+b \mm Y^n+(a+b)Y^{n+1},
$$
and multiplying by $\mm$ from the left we obtain $0=(a+b)\mm Y^{n+1}$ since $\mm^2=0$. Hence $b=-a$, which concludes the proof of~ii).

\medskip

For the rest of the proof we assume $a\ne 0$ and $d=m_0\ne 1$ and we claim that
\begin{equation}\label{valores}
\mm_{n+1,0}=d\quad\text{and}\quad \mm_{n+1,1}=-d.
\end{equation}
For this we evaluate~\eqref{eq38} at the entry $(1,0)$, noting that
$(Y^n\mm)_{10}=\mm_{n+1,0}$, $(\mm Y^{n-1}\mm)_{10}=1-m_0$ and that $(Y^j\mm Y^{n-j})_{10}=0$ if $j<n$. So we obtain
$$
(1-m_0)\mm_{n+1,0}=m_0(1-m_0),
$$
 and since $m_0\ne 1$, we have $\mm_{n+1,0}=m_0=d$.

Now we compute $\mm_{n+1,1}$. For this we evaluate~\eqref{eq38} at the entry $(1,1)$, noting that
$(Y^n\mm)_{11}=\mm_{n+1,1}$, $(\mm Y^{n-1}\mm)_{11}=-1-m_1$, $(Y^{n-1}\mm Y)_{11}=\mm_{n,0}=m_0$ and that $(Y^j\mm Y^{n-j})_{11}=0$ if $j<n-1$. So
$$
(1-m_0)\mm_{n+1,1}=m_0(-1-m_1)+(m_0+m_1)m_0=-m_0(m_0+m_1),
$$
and since $m_0\ne 1$, we have $\mm_{n+1,1}=-m_0$, concluding the proof of~\eqref{valores}.

\medskip

Now, using~\eqref{valores}, $0=(\mm^2)_{n0}$ gives
\begin{equation}\label{eq1}
0=d+c+db+da,
\end{equation}
and $0=(\mm^2)_{n1}$ yields
\begin{equation}\label{eq2}
0=-d-c+cb-da.
\end{equation}
We also rewrite~\eqref{primera ecuacion} as
\begin{equation}\label{eq3}
  (a+1)(c+d)+b+a=0.
\end{equation}
Adding~\eqref{eq1} and~\eqref{eq2} yields $(c+d)b=0$, and so, if $b\ne 0$, then $c=-d$ and~\eqref{eq3} yields $b=-a$, proving~iii).

\medskip

Finally, if $b=0$, then~\eqref{eq1} yields
\begin{equation}\label{segunda ecuacion}
  ad+c+d=0
\end{equation}
and from~\eqref{eq3} it follows that $ac+a=0$, hence $c=-1$. Then~\eqref{segunda ecuacion} implies $d(a+1)=1$, which concludes the proof of~iv).
\end{proof}

\section{The family $A(n,d,a)$}
\label{seccion 5}
In this subsection we will describe the case~(1) of Proposition~\ref{clasificacion}. We will prove that the resulting twisting map depends
only on $n$, $d$ and $a$. We obtain a family of twisted tensor products $A(n,d,a)$, parameterized by $n\in\mathds{N}$,$n\ge 2$, and $(a,d)\in K^2$,
such that for an infinite family of polynomials $R_k$ (see Definition~\ref{definicion Rk}) we have $R_k(a,d)\ne 0$.

\begin{proposition}\label{inductivo Anda}
Let $A$ be an associative $K$-algebra, $a,d\in K$ with $(d,a)\ne (1,0)$, $\mm,Y\in A$ such that
\begin{equation}\label{nivel uno}
d\mm Y^{n-1}\mm=e Y^n \mm+a \mm Y^n,
\end{equation}
where $e:=1-d$. Then for all $k\ge 1$ we have

\begin{equation}\label{nivel k}
d_k\mm Y^{kn-1}\mm=e_k Y^{kn} \mm-a_k \mm Y^{kn},
\end{equation}
 where $e_k=e^k$, $a_k=(-a)^k$ and
 $$
 d_k=d\sum_{j=0}^{k-1} e_j a_{k-1-j}=\begin{cases} d\frac{e^k-(-a)^k}{e+a}& \text{if } e\ne -a\\
 &\\
 kd e^{k-1}& \text{if } e=-a
 \end{cases}
 $$
\end{proposition}

\begin{proof}
If $d=0$, then $e=1$ and~\eqref{nivel uno} reads $Y^n\mm=-a \mm Y^n$. A direct computation shows that then $Y^{kn}\mm=(-a)^k \mm Y^{kn}$, which
is~\eqref{nivel k} in this case.

Now assume $d\ne 0$. Then a straightforward computation shows that
\begin{equation}\label{ecuacion dk}
  e_k-\frac{a d_k}{d}=\frac{d_{k+1}}{d}.
\end{equation}
Now we proceed by induction on $k$. For $k=1$, equality~\eqref{nivel k} is just~\eqref{nivel uno}.
Assume that~\eqref{nivel k} holds for some $k$. Multiplying~\eqref{nivel k} by $\mm Y^{n-1}$ from the left yields
$$
d_k \mm Y^{n-1}\mm Y^{kn-1}\mm=e_k \mm Y^{n(k+1)-1}\mm-(-a)^k\mm Y^{n-1}\mm Y^{kn}.
$$
Using~\eqref{nivel uno} we obtain
$$
d_k\left(\frac{e}{d}Y^n \mm Y^{kn-1}\mm+\frac ad \mm Y^{(k+1)n-1}\mm \right)=
e_k  \mm Y^{n(k+1)-1}\mm-a_k\left(\frac{e}{d}Y^n \mm Y^{kn}+\frac ad \mm Y^{(k+1)n}\right)
$$
and by the inductive hypothesis we get
$$
\left( e_k-\frac{a d_k}{d}\right)\mm Y^{n(k+1)-1}\mm = \frac {eY^n}d\left( e_k Y^{kn} \mm-a_k \mm Y^{kn}  \right)+
a_k\left(\frac{e}{d}Y^n \mm Y^{kn}+\frac ad \mm Y^{(k+1)n}\right).
$$
From this and~\eqref{ecuacion dk} it follows that
$$
\frac{d_{k+1}}d \mm Y^{n(k+1)-1}\mm=  \frac {e e_k}d  Y^{(k+1)n} \mm+\frac {aa_k}d \mm Y^{(k+1)n},
$$
and since $e e_k=e_{k+1}$ and $a a_k=-a_{k+1}$, multiplying by $d$ we arrive at
$$
d_{k+1}\mm Y^{n(k+1)-1}\mm=  e_{k+1}  Y^{(k+1)n} \mm-a_{k+1} \mm Y^{(k+1)n},
$$
which completes the induction step and concludes the proof.
\end{proof}

\begin{theorem}\label{anda}
Let $\sigma$ be a twisting map, assume that $Y$ and $M$ are as in Corollary~\ref{graded condition} and set $\mm=M-Y$.
 Let $n\in\mathds{N}$ with $n\ge 2$, take $a,d\in K$ with $(d,a)\ne (1,0)$ and assume that $\mm_{k,*}=\mm_{0,*}$ for $k<n$, and that
\begin{equation}\label{nivel uno a}
d\mm Y^{n-1}\mm=e Y^n \mm+a \mm Y^n,
\end{equation}
with $e=1-d$. Define
$$
d_k:=d\sum_{j=0}^{k-1} e_j a_{k-1-j},\quad e_k:=e^k\quad\text{and}\quad a_k:=(-a)^k.
$$
Then
\begin{equation}\label{no se anulan}
d_k+e_k\ne 0\quad\text{for all $k\in \mathds{N}$},
\end{equation}

$$
\mm_{kn+j,0}=-\mm_{kn+j,1}=d\prod_{i=2}^{k}\frac{d_i}{d_i+e_i}\quad\text{for $k\ge 1$ and $0\le j<n$,}
$$

$$
\mm_{kn+j,rn}=-\mm_{kn+j,rn+1}=\frac{a_r}{e_r+d_r}\prod_{i=r+1}^{k}\frac{d_i}{d_i+e_i}\quad\text{for $k\ge r\ge 1$ and $0\le j<n$,}
$$
and all other entries of $\mm$ are zero.
\end{theorem}

\begin{proof}

We first prove that
\begin{equation}\label{el siguiente es igual}
\mm_{kn,*}=\mm_{kn+j,*}\quad\text{for $k\ge 1$ and $0< j<n$.}
\end{equation}
 Let $i\in\{0,\dots,n-2\}$. If $a\ne 0$, then multiplying the equality~\eqref{nivel k} by $\mm Y^i$ from the left
yields $\mm Y^{kn+i}\mm=0$ and similarly, if $e\ne0$, then multiplying~\eqref{nivel k} by $Y^i \mm $ from the right
yields $\mm Y^{kn+i}\mm=0$. Since $(e,a)\ne (0,0)$ we obtain $\mm Y^{kn+i}\mm=0$ for $i=0,\dots,n-2$ and Lemma~\ref{mixtos}(2)
implies~\eqref{el siguiente es igual}.

It suffices to prove~\eqref{no se anulan}
and that
\begin{equation}\label{coeficientes}
Y^{kn}\mm=\sum_{i=0}^k c_{k,i}M^{(k-i)n}\mm Y^{in},
\end{equation}
where $c_{k,0}=d\prod_{i=2}^{k}\frac{d_i}{d_i+e_i}$ and $c_{k,r}=\frac{a_r}{e_r+d_r}\prod_{i=r+1}^{k}\frac{d_i}{d_i+e_i}$ for $1\le r\le k$.

First we assume $d,a\ne 0$ and prove~\eqref{no se anulan} and~\eqref{coeficientes} by induction on $k$.
For $k=1$ multiply the equality $Y^{n-1}\mm=M^{n-1}\mm$ with $M$ from the left, and obtain
$$
M^n\mm=M Y^{n-1}\mm=\mm Y^{n-1}\mm+Y^n \mm.
$$
Using~\eqref{nivel uno a} we get
$$
M^n\mm=\frac ed Y^n \mm+\frac ad \mm Y^n+Y^n \mm,
$$
so
$$
\frac{e+d}{d}Y^n \mm= M^n \mm-\frac ad \mm Y^n,
$$
and since $e+d=1$, this gives
$$
Y^n \mm= d M^n \mm-a \mm Y^n,
$$
which is~\eqref{coeficientes} for $k=1$, since $c_{1,0}=d$ and $c_{1,1}=-a$ (note that the empty product takes the value 1).

Now assume that~\eqref{coeficientes} holds for $k-1\ge 1$ and that $e_i+d_i\ne 0$ for $i<k$.
By~\eqref{nivel k} we have
$$
e_k Y^{kn} \mm= d_k\mm Y^{kn-1}\mm + a_k \mm Y^{kn}=-d_k Y^{kn}\mm+d_k M Y^{kn-1}\mm +a_k \mm Y^{kn},
$$
and so
$$
(e_k+d_k)Y^{kn}=d_k M Y^{kn-1}\mm +a_k \mm Y^{kn}.
$$
By the inductive hypothesis and~\eqref{el siguiente es igual} we have
$$
Y^{kn-1}\mm=M^{n-1}\sum_{j=0}^{k-1}c_{k-1,j}M^{n(k-1-j)}\mm Y^{nj}
$$
and so
\begin{equation}\label{coeficientes induccion}
(e_k+d_k)Y^{kn}=d_k \sum_{j=0}^{k-1}c_{k-1,j}M^{n(k-j)}\mm Y^{nj}+a_k \mm Y^{kn}.
\end{equation}
Evaluating the matrix equality~\eqref{coeficientes induccion} at the entry $(0,kn)$ yields $e_k+d_k\ne 0$. In fact, since
$(M^{n(k-j)})_{0,*}=(1,0,0,\dots,0,\dots)$ for $j<n$, we have $(M^{n(k-j)}\mm Y^{nj})_{0,kn}=0$ for $j<n$ (note that $\mm Y^{nj}$ is of degree $-nj$),
which implies
$$
(e_k+d_k)(Y^{kn})_{0,kn}=a_k(\mm Y^{kn})_{0,kn}=a_k \mm_{0,0}=a_k\ne 0.
$$
The equality~\eqref{coeficientes induccion} also implies that~\eqref{coeficientes} holds for $k$ with
$$
c_{k,k}=a_k\quad\text{and}\quad c_{k,j}=\frac{d_k c_{k-1,j}}{e_k+d_k}\quad\text{for $j<k$.}
$$
This completes the induction step and concludes the proof in the case $a,d\ne 0$.

If $d=0$, then $d_k=0$ and  $e_k=1$ for all $k$, $c_{k,j}=0$ for $j<k$, and from $Y^n \mm=-a \mm Y^n$ it follows that
$$
Y^{kn}\mm=(-a)^k \mm Y^{kn}=c_{k,k}  \mm Y^{kn},
$$
as desired.

Finally, if $a=0$, then $\frac{e_k}{d_k}=\frac{1-d}d$, hence by\eqref{nivel k}, Lemma~\ref{mixtos}(2) and~\eqref{el siguiente es igual}
  we obtain
$$
\mm_{kn,*}=d \mm_{kn-1,*}=d \mm_{(k-1)n,*},
$$
and so~\eqref{coeficientes} holds with $c_{k,0}=d^k$ and $c_{k,j}=0$ for $j>0$, which concludes the proof, since $e_k+d_k=e^{k-1}\ne 0$
(note that $e=0$ leads to the contradiction $(d,a)=(1,0)$).
\end{proof}

\begin{definition}\label{definicion Rk}
  For $a,d\in K$ and $k\in\mathds{N}$ we define the polynomial
  $$
  R_k(a,d):=(1-d)^k+d\sum_{j=0}^{k-1}(1-d)^j(-a)^{k-1-j}.
  $$
\end{definition}
Note that $R_k(a,d)=e_k+d_k$, where $e_k,d_k$ are defined in Theorem~\ref{anda}. We have $R_1(a,d)=1$ and $R_2(a,d)=1-d-ad$, so $R_2(a,d)\ne 0$
implies $(a+1)d\ne 1$, in particular $(a,d)=(0,1)$ is not allowed if we require $R_2(a,d)\ne 0$.

\begin{corollary}\label{Corolario anda}
Let $a,d\in K$ be such that for all $k$ we have $R_k(a,d)\ne 0$. Then the formulas in
Theorem~\ref{anda} define a matrix  $M$ that determines a twisting map via Corollary~\ref{graded condition}.
\end{corollary}

\begin{proof}
Note that
$$
M_{ij}=\begin{cases}
         \mm_{ij}, & \mbox{if }i\ge j  \\
         \mm_{ij}+1, & \mbox{if } i+1=j.
       \end{cases}
$$
Then $M_{0*}=(1,0,0,\dots )$, since $\mm_{0*}=(1,-1,0,0,\dots)$, and so by Corollary~\ref{graded condition} we have to prove that $M$ satisfies

\begin{equation}\label{matrix condition}
  Y^k M=\sum_{j= 0}^{k+1} M_{kj}M^{k+1-j} Y^j
\end{equation}
for all $k$.

For $k=0$ this is clear. For $k=1,\dots,n-1$ the equality~\eqref{matrix condition} reads $Y^k M=M^{k+1}-M^k Y+Y^{k+1}$, which is equivalent to
$Y^k \mm=M^k \mm$. A straightforward computation as in Lemma~\ref{mixtos} shows that these equalities are satisfied if and only if
$$
\mm Y^{k-1}\mm =0\quad\text{for $k=1,\dots , n-1$.}
$$
We claim that
\begin{equation}\label{igualdad en casi todos los niveles}
\mm Y^{nk+j}\mm =0\quad\text{for $k\ge 0$ and $j=0,\dots , n-2$.}
\end{equation}
A similar computation as above shows that then it suffices to prove~\eqref{matrix condition} for all $k=rn$ because~\eqref{igualdad en casi todos los niveles}
implies~\eqref{matrix condition} for all other $k$.
Now we prove~\eqref{igualdad en casi todos los niveles}:

Since the only non zero entries in $\mm_{k*}$ are of the form $\mm_{k,rn}$ or $\mm_{k,rn+1}$ for some $r\ge 0$, and
$\mm_{k,rn+1}=-\mm_{k,rn}$, it suffices to verify that
$$
(Y^{nk+j}\mm)_{rn,l}=(Y^{nk+j}\mm)_{rn+1,l}\quad\text{for $j=0,\dots,n-2$.}
$$
But this is equivalent to $\mm_{(r+k)n+j,l}=\mm_{(r+k)n+j+1,l}$ for $j=0,\dots,n-2$, which holds by the definition
of $\mm$ and so ~\eqref{igualdad en casi todos los niveles} is true.

It only remains to prove~\eqref{matrix condition} for $k=rn$ with $r\ge 1$. A straightforward computation using~\eqref{igualdad en casi todos los niveles}
shows that it suffices to prove~\eqref{nivel k} for all $k$, and by Proposition~\ref{inductivo Anda} we only have to prove that $\mm$
satisfies~\eqref{nivel uno}.

We will prove the equality~\eqref{nivel uno} in each entry $(l,nk+j)$.
Since the columns $\mm_{*,nk+j}$ vanish for $j=2,\dots,n-1$ and $\mm_{*,nk}=-\mm_{*,nk+1}$, it suffices to prove~\eqref{nivel uno} at the entries
$(l,nk)$.
So we have to prove
$$
d(\mm Y^{n-1}\mm)_{l,nk}=e (Y^n \mm)_{l,nk}+a(\mm Y^n)_{l,nk}\quad\text{for $l\ge 0$ and $k\ge 1$.}
$$
But
$$
(\mm Y^{n-1}\mm)_{l,nk}=M_{l,*}\cdot(Y^{n-1}\mm)_{*,nk},\quad (Y^n \mm)_{l,nk}=\mm_{l+n,nk},\quad (\mm Y^n)_{l,nk}=(\mm)_{l,n(k-1)}
$$
and $\mm_{l*}=\mm_{rn,*}$
for $l=rn+j$  with $j=0,\dots, n-1$, hence it suffices to prove
\begin{equation}\label{igualdad 518 en entradas}
  d(M_{rn,*}\cdot(Y^{n-1}\mm)_{*,nk})=e \mm_{(r+1)n,nk}+a \mm_{rn,n(k-1)}\quad\text{for all $r,k$.}
\end{equation}
Note that $\mm_{i,j}=0$ if $i<0$ or $j<0$.

By definition
\begin{equation}\label{fila}
 \mm_{rn,*}=\sum_{i=0}^r c_{r,i}(E_{in}-E_{in+1}),
\end{equation}
where $E_j$ is the infinite vector with $(E_j)_i=\delta_{ij}$,
\begin{equation}\label{coeficientes c}
 c_{k,0}=d\prod_{i=2}^{k}\frac{d_i}{d_i+e_i} \quad\text{for $k\ge 1$,}\quad
 c_{k,r}=\frac{a_r}{e_r+d_r}\prod_{i=r+1}^{k}\frac{d_i}{d_i+e_i} \quad \text{for $1\le r\le k$}
\end{equation}
 and $c_{k,r}=0$ for all other $(k,r)$.

Since $(Y^{n-1}\mm)_{*,nk}=(\mm_{n-1,nk},\mm_{n,nk},\mm_{n+1,nk},\dots)$ we have
$$
M_{rn,*}\cdot(Y^{n-1}\mm)_{*,nk}=\sum_{i=0}^r c_{r,i}(\mm_{in+n-1,nk}-\mm_{in+1+n-1,nk})=\sum_{i=0}^r c_{r,i}(c_{i,k}-c_{i+1,k}).
$$
Moreover,
$$
e \mm_{(r+1)n,nk}=e c_{r+1,k}\quad\text{and}\quad a \mm_{rn,n(k-1)}= a c_{r,k-1}\quad\text{(note that $c_{r,-1}=0$)}
$$
so~\eqref{igualdad 518 en entradas} reads
\begin{equation}\label{igualdad 518 mayor que cero}
d \sum_{i=0}^r c_{r,i}(c_{i,k}-c_{i+1,k})= e c_{r+1,k}+a c_{r,k-1}.
\end{equation}
In order finish the proof it suffices to prove~\eqref{igualdad 518 mayor que cero} for all $r,k$. For this
we will use
\begin{equation}\label{ecuacion util}
  e d_r+d a_r=d_{r+1},
\end{equation}
which follows directly from the definitions of $a_r$, $e_r$ and $d_r$.

For $k>r+1$ the equality~\eqref{igualdad 518 mayor que cero} is trivially true, since in that case both sides vanish.
If $k=r+1$, then~\eqref{igualdad 518 mayor que cero} reads

\begin{equation}\label{caso r+1}
-d c_{r,r}c_{r+1,r+1}=e c_{r+1,r+1}+a c_{r,r}.
\end{equation}

Since $c_{r,r}(e_r+d_r)=a_r$ (note that $e_0=a_0=1$ and $d_0=0$), this is equivalent to
$$
-d a_{r}a_{r+1}=e a_{r+1}(e_r+d_r)+a a_{r}(e_{r+1}+d_{r+1}).
$$
Now we divide by $a_{r+1}=-a a_r$ and so we have to prove that
$$
-d a_r=e(e_r+d_r)-(e_{r+1}+d_{r+1}).
$$
But this follows directly from~\eqref{ecuacion util} using that $e_{r+1}=e e_r$, hence the case $k=r+1$ is proved.

Now we can assume that $k\le r$ and we will use
that for $i\le r$ we have
\begin{equation}\label{cr inductivo}
  c_{r+1,i}=c_{r,i}\frac{d_{r+1}}{d_{r+1}+e_{r+1}}.
\end{equation}

We prove~\eqref{igualdad 518 mayor que cero} by induction on $r$ (assuming $k\le r$ and using that~\eqref{igualdad 518 mayor que cero} is true for $k=r+1$). For $r=0=k$ this means
$$
d c_{0,0}(c_{0,0}-c_{1,0})=  e c_{1,0}+a c_{0,-1}.
$$
Using $c_{0,0}=1$ and $c_{1,0}=d=1-e$ we see that this equality is equivalent to $d(1-d)=ed$ which is true by definition of $e$.

Assume~\eqref{igualdad 518 mayor que cero} is true for some $r-1\ge 0$. Multiplying~\eqref{ecuacion util} by
$e_{r+1}=e e_r$ we obtain
$$
e d_r e_{r+1}+d a_r e_{r+1}=e e_r d_{r+1},
$$
and adding $e d_r d_{r+1}$ this reads
$$
d_r e(e_{r+1}+d_{r+1})+d a_r e_{r+1}=e d_{r+1}(e_r+d_r).
$$
We divide this equality by $(e_r+d_r)$ in order to obtain
$$
\frac{d_r}{e_r+d_r} e(e_{r+1}+d_{r+1})+d c_{r,r} e_{r+1}=e d_{r+1},
$$
using that $a_r=c_{r,r}(e_r+d_r)$. Now we divide by $(e_{r+1}+d_{r+1})$ and can write the result as
$$
\frac{d_r}{e_r+d_r} e + d c_{r,r} \left(1-\frac{d_{r+1}}{d_{r+1}+e_{r+1}}\right)=e \frac{d_{r+1}}{d_{r+1}+e_{r+1}}.
$$
Next we multiply by $c_{r,k}$ and, since by~\eqref{cr inductivo} we know that $c_{r+1,k}=c_{r,k} \frac{d_{r+1}}{d_{r+1}+e_{r+1}}$,
it follows that
\begin{equation}\label{ecuacion intermedia}
\frac{d_r}{e_r+d_r} e c_{r,k} + d c_{r,r} (c_{r,k}-c_{r+1,k})=e c_{r+1,k}.
\end{equation}
We claim that
\begin{equation}\label{igualdad en la suma}
e c_{r,k} = d \sum_{i=0}^{r-1}c_{r-1,i}(c_{i,k}-c_{i+1,k}).
\end{equation}
In fact, if $k<r$, this follows from the inductive hypothesis, and if $k=r$,
then~\eqref{caso r+1} gives the same equality. Now the equality~\eqref{igualdad en la suma} implies
$$
\frac{d_r}{e_r+d_r} e c_{r,k}=
\frac{d_r}{e_r+d_r} d \sum_{i=0}^{r-1}c_{r-1,i}(c_{i,k}-c_{i+1,k})= d \sum_{i=0}^{r-1}c_{r,i}(c_{i,k}-c_{i+1,k}),
$$
where the second equality follows from~\eqref{cr inductivo}. So the equality~\eqref{ecuacion intermedia}
yields
$$
d \sum_{i=0}^{r-1}c_{r,i}(c_{i,k}-c_{i+1,k})+ d c_{r,r} (c_{r,k}-c_{r+1,k})=e c_{r+1,k},
$$
which is~\eqref{igualdad 518 mayor que cero} for $r$. This completes the inductive step, proves~\eqref{igualdad 518 mayor que cero} and
concludes the proof.
\end{proof}

\section{Roots of $R_k$}
\label{seccion 6}
In view of Corollary~\ref{Corolario anda}, we want to analyze the polynomials $R_k$ and their roots.
In particular we are interested in the following question: Given a pair $(a,d)$, does there exists  $k\in\mathds{N}$ such that $R_k(a,d)=0$?
If the answer is no, then for each $n\ge 2$ the pair $(a,d)$ defines a unique twisting map via Theorem~\ref{anda}. Else
there is no twisting map satisfying item~(1) of Proposition~\ref{clasificacion} for that $(a,d)$.

Fix $(a,d)$. If $-a=1-d=e$, then $d_k=kd e^{k-1}$. So $R_k(a,d)=e^k+kd e^{k-1}=e^{k-1}(kd+e)=0$ if and only if $0=kd+e=d(k-1)+1$. In that case
$a=1-d=-\frac{k}{k-1}$.

Now assume  $-a\ne 1-d=e$. Then
$$
R_k(a,d)=e^k+d\frac{e^k-(-a)^k}{e+a}=\frac{e^{k+1}+a e^k+d e^k-d(-a)^k}{e+a},
$$
so $R_k(a,d)=0$ if and only if
$$
0=e^{k+1}+a e^k+d e^k-d(-a)^k=(a+1)e^k-(1-e)(-a)^k
$$
In that case $e\ne 0$ and $e\ne 1$, since $e=0$ leads to $a=0$ and $e=1$ leads to
$a=-1$, which contradicts $-a\ne e$. So  $R_k(a,d)=0$ if and only if
\begin{equation}\label{ecuacion fraccion}
\frac{1+a}{1-e}=\frac{(-a)^k}{e^k}.
\end{equation}

This condition is much easier to handle than the original condition. Assume $K\subset\mathds{C}$.
If~\eqref{ecuacion fraccion} is satisfied and $\left|\frac{a}{e}\right|\ne 1$, then
$$
k \log\left|\frac{a}{e}\right|=\log\left|\frac{1+a}{1-e}\right|.
$$
Moreover, if~\eqref{ecuacion fraccion} is satisfied and $\left|\frac{a}{e}\right|= 1$, then necessarily $\left|\frac{1+a}{1-e}\right|=1$,
and an elementary computation shows that then either $-a=e$ or $-a=\bar e$, where $\bar e$ is the complex conjugate of $e$.
The first case is impossible by assumption, and another elementary computation shows that~\eqref{ecuacion fraccion} is satisfied
if and only if $u^{2k-1}=-1$, where $u=\frac{e}{|e|}$ is a unitary complex number.
Hence, if $K\subset\mathds{C}$, we can describe a complete
strategy in order to determine if for a given pair $(a,d)$ we have
$R_k(a,d)\ne 0$ for all $k$.
\begin{enumerate}
  \item If $-a=1-d=:e$ then $R_k(a,d)\ne 0$ for all $k$ if and only if $(a,d)\ne \left(-\frac{k+1}{k},-\frac{1}{k}\right)$ for all $k\in\mathds{N}$.
  \item If $-a\ne 1-d=e$, then
  \begin{enumerate}
    \item[a)] if $\left|\frac{a}{e}\right|\ne 1$ then
    \begin{enumerate}
      \item[i)] if $\frac{\log\left|\frac{1+a}{1-e}\right|}{\log\left|\frac{a}{e}\right|}\notin \mathds{N}_{\ge 2}$, then $R_k(a,d)\ne 0$ for all $k$.
      \item[ii)] if $\frac{\log\left|\frac{1+a}{1-e}\right|}{\log\left|\frac{a}{e}\right|}=k_0\in \mathds{N}_{\ge 2}$, then $R_k(a,d)\ne 0$ for all $k$ if and only if $R_{k_0}(a,d)\ne 0$.
    \end{enumerate}
    \item[b)]  if $\left|\frac{a}{e}\right| = 1$ and $a\ne \bar e$, then $R_k(a,d)\ne 0$ for all $k$.
    \item[c)]  if $\left|\frac{a}{e}\right| = 1$ and $a= \bar e$, then $R_k(a,d)\ne 0$ for all $k$ if and only if $(1-e)/(1-\bar e)\ne u^{2k}$  all
    $k\in \mathds{N}_{\ge 2}$, where $u=\frac{e}{|e|}$.
  \end{enumerate}
\end{enumerate}

\section{The case $y^nx=d x^{n+1}-x^n y+(a+1)y^{n+1}$}
\label{seccion 7}
In this section we will describe the case~(2) of Proposition~\ref{clasificacion}. So $\sigma$ is a twisting map and $Y$ and $M$ are as in Corollary~\ref{graded condition} and $\mm=M-Y$.
Moreover $n\in\mathds{N}$ with $n\ge 2$, $\mm_{k*}=\mm_{0*}$ for $1< k< n$ and
$\mm_{n,*}=d E_0-E_1+a E_{n+1}$ with $d(a+1)=1$. This implies that we are dealing with the case
$$
y^nx=d x^{n+1}-x^n y+(a+1)y^{n+1},\quad\text{with $a\ne 0,-1$}.
$$
We will compute the different possibilities for the resulting twisting maps. There is only one choice for the first $2n-1$ rows, but four choices for the $2n$'th row. In each of the four cases
the rows are determined until the row $3n-1$. We show how to proceed to determine the rows $3n$, $3n+1$ and $3n+2$, in each of the four cases, and obtain again four cases (so we have 16 cases).
As the number of possibilities grows, the system of equations get more and more involved, so our methods don't provide a complete classification. However, in section~\ref{seccion familia}
we describe a family of twisting maps for which the first $3n+2$ rows coincide with four of the 16 cases.

\begin{lemma}\label{producto en la diagonal}
  Let $A\in L(K^{\mathds{N}_0})$ be an infinite matrix such that $A_{ij}=0$ for $j>i+1$. Then
  $$
  (A^{n+1})_{j,j+n+1}=\prod_{k=0}^n A_{j+k,j+k+1}.
  $$
\end{lemma}
\begin{proof}
  We have
  $$
  (A^{n+1})_{j,j+n+1}=\sum_{i_1,i_2,\dots,i_n}A_{j,i_1}A_{i_1,i_2}\cdots A_{i_n,j+n+1}.
  $$
  Set $i_0=j$ and $i_{n+1}=j+n+1$, then
  $$
  \sum_{k=0}^{n}(i_{k+1}-i_k)=i_{n+1}-i_0=n+1.
  $$
  But then
  $$
  \sum_{k=0}^{n}(i_{k+1}-i_k-1)=0,
  $$
  and since by assumption $A_{i_{k+1},i_k}=0$ for $i_{k+1}-i_k-1>0$, we obtain $i_{k+1}-i_k-1=0$ for all $k$. So if
  $A_{j,i_1}A_{i_1,i_2}\cdots A_{i_n,j+n+1}\ne 0$  then $i_{k+1}=i_k+1$ and so $i_k= j+k$ for all $k$. Then
  the only summand that can be non zero  is
  $$
  \prod_{k=0}^n A_{j+k,j+k+1},
  $$
  as desired.
\end{proof}

\begin{proposition}\label{condiciones para BnL}
Let $\mm$ and $a$ be as above. We have
\begin{equation}\label{MYM}
\mm Y^{n-1}\mm=a \sum_{j=0}^{n} Y^j \mm Y^{n-j}-a^2 Y^{n+1}
\end{equation}
and
\begin{equation}\label{potencia se anula}
  (\mm-aY)^{n+1}=0.
\end{equation}
Moreover, set $m_i:=\mm_{i,i+1}$ and let $L:=(L_1=n,L_2,L_3,\dots)$ be the increasing sequence of integers such
that $m_{L_i}\ne 0$ and $m_i=0$ if $L_k<i<L_{k+1}$  for some $k$. Then
\begin{enumerate}
  \item $\prod_{k=1}^{n+1}(m_{j+k}-a)=0$ for all $j\ge 0$.
  \item If $m_j\ne 0$, then $m_{j+k}=0$ for $k=1,\dots,n-1$.
  \item We have $m_{L_i}=a$ and $(L_{i+1}-L_{i})\in\{n,n+1\}$ for all $i\ge 1$.
\end{enumerate}
\end{proposition}

\begin{proof}
From
$$
Y^n\mm=d \mm^{n+1}-M^n Y+a Y^{n+1}
$$
and Lemma~\ref{mixtos 2} we obtain
\begin{eqnarray*}
Y^n \mm &=& d\left(Y^{n+1}+\mm Y^{n-1}\mm + \sum_{j=0}^n Y^j \mm Y^{n-j} \right)-\left(Y^{n}+\sum_{j=0}^{n-1} Y^j \mm Y^{n-1-j}\right)Y+a Y^{n+1} \\
   &=& (d-1) \sum_{j=0}^{n-1} Y^j \mm Y^{n-j}+d Y^n \mm+d\mm Y^{n-1}\mm+(d-1+a)Y^{n+1}.
\end{eqnarray*}
So
$$
0=d\mm Y^{n-1}\mm-(1-d) \sum_{j=0}^{n} Y^j \mm Y^{n-j}+(d-1+a)Y^{n+1}
$$
and
$$
0=d\mm Y^{n-1}\mm-ad \sum_{j=0}^{n} Y^j \mm Y^{n-j}+(a-ad)Y^{n+1}
$$
follows from $(1-d)=ad$. Using again $(1-d)=ad$ and dividing by $d$ we obtain~\eqref{MYM}. Multiplying by $a^{n-1}$ we obtain
$$
0=\mm (aY)^{n-1}\mm- \sum_{j=0}^{n} (aY)^j \mm (aY)^{n-j}+(aY)^{n+1}.
$$
But the right hand side is the expansion of $(aY-\mm)^{n+1}$, since in that expansion
the only term with two times the factor $\mm$ is $\mm (aY)^{n-1}\mm$. This proves~\eqref{potencia se anula}.
Item~(1) follows directly from~\eqref{potencia se anula} and Lemma~\ref{producto en la diagonal}, since
$(\mm-aY)_{i,i+1}=m_i-a$.

By Lemma~\ref{mixtos 2} we have $\mm Y^k\mm =0$ for $k=0,\dots,n-2$. But then
$$
0=\left(\mm Y^{k-1}\mm\right)_{j,j+k+1}=\mm_{j,j+1} \mm_{j+k,j+k+1}=m_j m_{j+k}
$$
for $k=1,\dots,n-1$, so item~(2) is true.

Item~(2) implies that $L_{i+1}-L_i\ge n$. Assume by contradiction that $L_{i+1}-L_i> n+1$. Then
$$
\prod_{k=1}^{n+1}(m_{L_i+k}-a)=(-a)^{n+1}\ne 0,
$$
 contradicting item~(1), hence $(L_{i+1}-L_{i})\in\{n,n+1\}$ for all $i\ge 1$.

Finally, if $m_{L_i}\ne a$ for some $i>1$, then
$$
\prod_{k=1}^{n+1}(m_{L_i-2+k}-a)=(-a)^{n}(m_{L_i}-a)\ne 0,
$$
contradicting again item~(1), hence $m_{L_i}=a$ for all $i$.
\end{proof}

\begin{proposition}\label{twisting Lr}
  Assume that for some $k\ge 1$ there exists an increasing sequence $(L_1,\dots,L_{k})$ such that for $i\le L_{k}+n-1$ we have
$$
\mm_{i,*}=\begin{cases}
            d^j \mm_{0,*}, & \mbox{if } L_j<i<L_{j+1} \\
            &\\
            d^j E_0- d^{j-1}E_1+a E_{L_j+1}, & \mbox{if $i=L_j$}\\
            &\\
            d^k \mm_{0,*}, & \mbox{if } L_k<i \\
          \end{cases}
$$
Set $t_i=M_{L_k+n,i}$. Then
\begin{enumerate}
  \item $(\mm_{L_k+n+1,0},\mm_{L_k+n+1,1},\mm_{L_k+n+1,2})=(d^{k+1},-t_0,-t_1-d^k)$,
  \item $\mm_{L_k+n+1,j}=-t_{j-1}$ for $3\le j\le L_k+n+1$,
   \item $t_0\in\{d^k,d^{k+1}\}$,
   \item $(\mm_{L_k+n,L_k+n+1},\mm_{L_k+n+1,L_k+n+2})\in\{(a,0),(0,a)\}$.
\end{enumerate}
\end{proposition}
\begin{proof}
We compute the entries $(L_k+1,j)$ of~\eqref{MYM} and obtain
$$
(\mm Y^{n-1}\mm)_{L_k+1,j}=a \sum_{i=0}^{n} (Y^i \mm Y^{n-i})_{L_k+1,j}-a^2 (Y^{n+1})_{L_k+1,j}.
$$
Since $\mm_{L_k+1,*}=d^k \mm_{0,*}=d^k(E_0-E_1)$, $(Y^i \mm Y^{n-i})_{L_k+1,j}=\mm_{L_k+1+i,j+i-n}$ and $(Y^{n+1})_{L_k+1,j}=\delta_{L_k+n+2,j}$
 we obtain
\begin{equation}\label{MYMentrada}
d^k(\mm_{n-1,j}-\mm_{n,j})=a \sum_{i=0}^{n} \mm_{L_k+1+i,j+i-n}-a^2  \delta_{L_k+n+2,j},
\end{equation}
where $\mm_{i,j}=0$ if $j<0$.

For $j=0$ the only term that survives in the sum of~\eqref{MYMentrada}, is the term corresponding to $i=n$, and so
$$
d^k(1-d)=a\mm_{L_k+1+n,0}.
$$
Since $1-d=ad$, we obtain $\mm_{L_k+n+1,0}=d^{k+1}$. When we compute ~\eqref{MYMentrada} for $j=1$
the only two terms that survive in the sum are the terms corresponding to $i=n$ and $i=n-1$. Hence
$$
d^k(1-1)=a(\mm_{L_k+1+n,1}+\mm_{L_k+n,0}),
$$
and so $\mm_{L_k+1+n,1}=-t_0$.
Similarly, for $j=2$ only the three terms corresponding to $i=n,n-1,n-2$ survive and we obtain
$$
0=\mm_{L_k+1+n,2}+\mm_{L_k+n,1}+\mm_{L_k-1+n,0},
$$
which gives $\mm_{L_k+1+n,2}=-t_1-d^k$, since $\mm_{L_k-1+n,0}=d^k$.
This proves item~(1).
In order to prove item~(2), note that $\mm_{i,j}=0$ if $L_k<i<L_k+n$ and $j\ne 0,1$.
Hence the only terms that survive in the sum of~\eqref{MYMentrada} for $j=3,\dots,n$ are
$\mm_{L_k+n+1,j}$, $\mm_{L_k+n,j-1}$, $\mm_{L_k+1+n-j,0}$ and $\mm_{L_k+2+n-j,1}$.
But $\mm_{L_k+1+n-j,0}+\mm_{L_k+2+n-j,1}=0$ and $\mm_{n-1,j}=0=\mm_{n,j}$ for that $j$, so from~\eqref{MYMentrada} we obtain
$$
\mm_{L_k+n+1,j}=-t_{j-1},\quad\text{for $j=3,\dots,n$.}
$$
Consider the equality~\eqref{MYMentrada} for $j=n+1$. On the left hand side we have $-d^k \mm_{n,n+1}=-d^k a$ and on the right hand side
the only possibly nonzero terms correspond to $i=0$, $i=n-1$ and $i=n$. This yields
$$
-d^k a=a(\mm_{L_k+1,1}+\mm_{L_k+n,n}+\mm_{L_k+n+1,n+1}),
$$
and since $\mm_{L_k+1,1}=-d^k$, we obtain $\mm_{L_k+n+1,n+1}=-t_n$, as desired.
If $n+1<j<L_k+n+2$, then only the two terms $\mm_{L_k+n+1,j}$ and $\mm_{L_k+n,j-1}$ survive, and we obtain
$$
\mm_{L_k+n+1,j}=-t_{j-1},
$$
which concludes the proof of item~(2).

In order to prove item~(3), we consider the entry $(1,0)$ of the equality
$$
Y^{L_k+n}\mm=\sum_{i=0}^{L_k+n+1} t_i M^{L_k+n+1-i} Y^i,
$$
i.e.
$$
(Y^{L_k+n}\mm)_{1,0}=t_0 (M^{L_k+n+1})_{1,0},
$$
since the entry $(1,0)$ vanishes for all summands with $i>0$. From
\begin{equation}\label{entrada de M es d}
 (Y^{L_k+n}\mm)_{1,0}=\mm_{L_k+n+1,0}=d^{k+1},
\end{equation}
we obtain
$$
d^{k+1}=t_0(M^{L_k+n}\mm)_{1,0}.
$$
But $M^{L_k+n-1}\mm=\frac{1}{d^k}Y^{L_k+n-1}\mm$, consequently
$$
d^{k+1}=\frac{t_0}{d^k}(\mm Y^{L_k+n-1}\mm+Y^{L_k+n}\mm)_{1,0}
$$
and multiplying by $d^k$ and using~\eqref{entrada de M es d} we obtain
$$
(d^k-t_0)d^{k+1}=t_0 (\mm Y^{L_k+n-1}\mm)_{1,0}=t_0(1,-1)\cdot(\mm_{L_k+n-1,0},\mm_{L_k+n,0})=t_0(d^k-t_0).
$$
Hence $(d^k-t_0)(d^{k+1}-t_0)=0$ from which item~(3) follows.
Finally, item~(4) follows from Proposition~\ref{condiciones para BnL}(3).
\end{proof}

\begin{lemma}\label{lema BNL}
    Assume that for some $k\ge 1$ there exist an increasing sequence $(L_1,\dots,L_{k+1})$ such that $L_1=n$, $L_{r+1}-L_r\in\{n,n+1\}$ for $0<r\le k$ and
$$
\mm_{j,*}=\begin{cases}
             \mm_{0,*}, & \mbox{if } j<L_1=n \\
             &\\
            d^r \mm_{0,*}, & \mbox{if } L_r<j<L_{r+1}, \ 0<r\le k \\
            &\\
            d^r E_0- d^{r-1}E_1+a E_{L_r+1}, & \mbox{if $j=L_r$ for some  } 0<r\le k\\
          \end{cases}
$$
Then for $0<r\le k$ and $L_r\le j<L_{r+1}$, we have
\begin{equation}\label{potencia de M}
d^r M^{j+1}=\sum_{i=0}^{j}Y^i \mm Y^{j-i}+(1-ra)Y^{j+1},
\end{equation}
and for $j=L_{k+1}$ we have
\begin{equation}\label{potencia maxima de M}
d^k M^{j+1}=\sum_{i=0}^{j}Y^i \mm Y^{j-i}+(1-ka)Y^{j+1}+\mm Y^{j-1}\mm.
\end{equation}
\end{lemma}

\begin{proof}

We will prove~\eqref{potencia de M} by induction on $j$.
Note first that if we set $L_0:=0$, then~\eqref{potencia de M} is true for $L_0\le j< L_1=n$ by Lemma~\ref{mixtos 2}.
Now assume that~\eqref{potencia de M} is true for $j$ and we will prove that it holds for $j+1$.
First assume that $L_r\le j<L_{r+1}-1$. Then
we multiply~\eqref{potencia de M} by $M=Y+\mm$ and obtain
\begin{eqnarray*}
  d^r M^{j+2}&=&\sum_{i=0}^{j}Y^{i} \mm Y^{j+1-i}+(1-ra)Y^{j+2}+(1-ra) Y^{j+1}\mm +\sum_{i=0}^{j} Y^i \mm Y^{j-i}\mm\\
   &=& \sum_{i=0}^{j}Y^{i} \mm Y^{j+1-i}+ Y^{j+1}\mm+(1-ra)Y^{j+2}-ra Y^{j+1}\mm +\sum_{i=0}^{j} Y^{j-i} \mm Y^{i}\mm.
\end{eqnarray*}
But $\mm Y^i \mm=0$ for $L_t<i<L_{t+1}-1$ and by Lemma~\ref{mixtos}(3)
$$
Y \mm Y^{L_t-1}\mm +\mm Y^{L_t}\mm =a Y^{L_t+1}\mm\quad\text{for $1\le t \le r$,}
$$
since $\mm_{L_t+1,*}=d \mm_{L_t-1,*}$ and $a=\frac{1-d}{d}$. So
$$
Y^{j-L_t+1} \mm Y^{L_t-1}\mm +Y^{j-L_t}\mm Y^{L_t}\mm =a Y^{j+1}\mm,
$$
and then
$$
\sum_{i=0}^{j} Y^{j-i} \mm Y^{i}\mm=\sum_{t=1}^{r}\left(Y^{j-L_t+1} \mm Y^{L_t-1}\mm +Y^{j-L_t}\mm Y^{L_t}\mm\right)=ra\, Y^{j+1}\mm
$$
which implies
$$
d^r M^{j+2}=\sum_{i=0}^{j+1}Y^{i} \mm Y^{j-i} +(1-ra)Y^{j+2},
$$
as desired.

Now, if $j=L_{r+1}-1$ for some $r\le k$, then, by the same argument as before, from~\eqref{potencia de M}  we obtain
$$
d^r M^{j+2}= \sum_{i=0}^{j+1}Y^{i} \mm Y^{j+1-i}+(1-ra)Y^{j+2}-ra Y^{j+1}\mm +\sum_{i=0}^{j} Y^{j-i} \mm Y^{i}\mm,
$$
and we also obtain
$$
\sum_{i=0}^{j-1} Y^{j-i} \mm Y^{i}\mm=ra Y^{j+1}\mm.
$$
Consequently
\begin{equation}\label{potencia casi completa}
d^r M^{j+2}=\sum_{i=0}^{j+1}Y^{i} \mm Y^{j+1-i}+ (1-ra)Y^{j+2}+\mm Y^{j}\mm,
\end{equation}
which implies~\eqref{potencia maxima de M}. For $j=L_{r+1}-1$ with $r<k$
we have to compute $\mm Y^{j}\mm$. Since $j=L_{r+1}-1$ we have $\mm_{j,*}=d^{r}\mm_{0,*}$, which implies
$Y^{j}\mm=d^{r}M^{j}\mm$ and multiplying by $M=\mm+Y$ we obtain
\begin{equation}\label{como hallar MYM}
  \mm Y^j \mm+ Y^{j+1}\mm=d^{r}M^{j+1}\mm.
\end{equation}
On the other hand from $\mm_{j+1,*}=\mm_{L_{r+1},*}=d^{r+1} E_0- d^{r}E_1+a E_{L_{r+1}+1}$ we obtain
$$
Y^{j+1}\mm=d^{r+1} M^{j+2}-d^r M^{j+1}Y+a Y^{j+2},
$$
and combining this with~\eqref{como hallar MYM} yields
$$
\mm Y^j \mm = d^{r}M^{j+1}\mm+ d^r M^{j+1}Y-d^{r+1} M^{j+2}-a Y^{j+2}=d^{r}M^{j+2}-d^{r+1} M^{j+2}-a Y^{j+2}.
$$

Inserting this into~\eqref{potencia casi completa} yields
$$
d^r M^{j+2}=\sum_{i=0}^{j+1}Y^{i} \mm Y^{j+1-i}+ (1-ra)Y^{j+2}+d^{r}M^{j+2}-d^{r+1} M^{j+2}-a Y^{j+2}
$$
and so
$$
d^{r+1} M^{j+2}=\sum_{i=0}^{j+1}Y^{i} \mm Y^{j+1-i}+ (1-(r+1)a)Y^{j+2},
$$
which is~\eqref{potencia de M} for $j+1$, since $j+1=L_{r+1}$ and so $L_{r+1}\le j+1 < L_{r+2}$.
This finishes the inductive step and concludes the proof.
\end{proof}

\section{Computing $\mm_{j,*}$ for $j\le 3n+2$}
\label{seccion 8}
In this section we will continue to describe the case~(2) of Proposition~\ref{clasificacion}.
So $\sigma$ is a twisting map and $Y$ and $M$ are as in Corollary~\ref{graded condition} and $\mm=M-Y$.
Moreover $n\in\mathds{N}$ with $n\ge 2$, $\mm_{k*}=\mm_{0*}$ for $1< k< n$ and
$\mm_{n,*}=d E_0-E_1+a E_{n+1}$ with $d(a+1)=1$.

 Moreover, if we set $t_i:=\mm_{2n,i}$, the first $2n+1$ rows of $\mm$ look as follows:
$$
\begin{pmatrix}
  1 & -1 & 0                 & & & & & & &  \\
  \vdots & \vdots & \vdots  & & & & & & & \\
  1 & -1 & 0                & & & & & & &  \\
  d & -1 & 0 & \cdots & a & & & & & \\
  d & -d & 0 &   \cdots     & 0  & 0 &       & & &  \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots & & &  \\
  d & -d & 0 &  \cdots& 0  & 0  &       &\ddots & &  \\
  t_0 & t_1 & t_2 & \cdots & t_{n+1} & t_{n+2} & \cdots & t_{2n} & t_{2n+1} &    \\
  d^2 & -t_0 & -d-t_1 & -t_2 & \cdots & -t_{n+1} & \cdots &  & -t_{2n} & a-t_{2n+1}
\end{pmatrix},
$$
with $t_0\in \{d,d^2\}$ and $t_{2n+1}\in\{0,a\}$.
 In fact,
$$
(\mm Y^{i-1}\mm)_{n,j}=(d,-1,0,\dots,a)\cdot (\mm_{i-1,j},\mm_{i,j},\dots,\mm_{n+i,j}))=\begin{cases}
                                                                                d-1+a\mm_{n+i,j}, & \mbox{if } j=0 \\
                                                                                -d+1+a\mm_{n+i,j}, & \mbox{if } j=1\\
                                                                                a\mm_{n+i,j}, & \mbox{if } j>1.
                                                                                \end{cases}
$$
yields $\mm_{n+i,*}=d\mm_{0,*}$ for $i=1,\dots,n-1$, since $1-d=ad$ and $(\mm Y^{i-1}\mm)=0$.
Hence we automatically are in the situation of Proposition~\ref{twisting Lr} and of Lema~\ref{lema BNL} for $k=1$.

By Proposition~\ref{twisting Lr} we have
$$
t_0\in \{d,d^2\},\quad \mm_{2n+1,0}=d^2,\quad \mm_{2n+1,1}=-t_0,\quad \mm_{2n+1,2}=-t_1-d
$$
and
$$
\mm_{2n+1,j+1}=-t_j\quad\text{for $j=2,\dots,2n$.}
$$
Proposition~\ref{twisting Lr} also yields $t_{2n+1}\in\{0,a\}$ and $\mm_{2n+1,2n+2}=a-t_{2n+1}$. The two choices for $t_0$ and the two choices for $t_{2n+1}$ generate four different cases for
$\mm_{2n,*}$ which we will describe in the next two propositions.
\begin{proposition}\label{BnL 2n+1}
  If $t_{2n+1}=\mm_{2n,2n+1}=0$, then
$$
\mm_{2n,*}=dE_0-dE_1\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-dE_1+a E_{2n+2}
$$
or
$$
\mm_{2n,*}=d^2 E_0-dE_1+ad E_{n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d^2 E_1-ad E_{n+2}+a E_{2n+2}.
$$
\end{proposition}

\begin{proof}
We have $t_{2n+1}=0$ and so $\mm_{2n+1,2n+2}=a$.
We first prove
\begin{equation}\label{tk se anula}
t_k=0\quad\text{for $k\notin\{0,1,n+1\}$.}
\end{equation}
Since $\mm_{2n,2n+1}=0$ we have
$$
0=(\mm^2)_{2n,2n}=(\mm_{2n,2n})^2
$$
and so $t_{2n}=\mm_{2n,2n}=0$.
Then
$$
0=(\mm Y\mm)_{2n,2n-1}=(\mm_{2n,2n-1})^2
$$
and so $t_{2n-1}=\mm_{2n,2n-1}=0$.
Inductively we obtain
$$
0=(\mm Y^k\mm)_{2n,2n-k}=(\mm_{2n,2n-k})^2
$$
and so $t_{2n-k}=\mm_{2n,2n-k}=0$ for $k=1,\dots,n-2$. So $t_j=0$ for $j=n+2,n+3,\dots,2n$. It remains to prove
$t_j=0$ for $j=2,\dots,n$. For this we consider

\begin{equation}\label{producto tk}
0=(\mm Y^{k}\mm)_{2n,n+1}=\mm_{2n,*}\cdot (Y^k\mm)_{*,n+1}(t_0,t_1,\dots,t_n,t_{n+1})\cdot (0,\dots,0,a,0,\dots,0)=a t_{n-k},
\end{equation}
since for $i<n+2$ we have $(Y^k\mm)_{i,n+1}=a\delta_{i+k,n}$. Since~\eqref{producto tk} is valid for $k=0,\dots,n-2$, we obtain
$t_j=0$ for $j=2,\dots,n$, which concludes the proof of~\eqref{tk se anula}.

Next we claim that
\begin{equation}\label{casos t0}
t_{n+1}(t_0-d^2)=0.
\end{equation}
For this we will evaluate the matrix equality (which holds by~\eqref{fundamental matrix equality})
\begin{equation}\label{matrix equality at 2n}
  Y^{2n}\mm=t_0 M^{2n+1}+t_1 M^{2n}Y+t_{n+1} M^n Y^{n+1}
\end{equation}
at $(1,n+1)$.

First we compute
\begin{equation}\label{2n at Y2nM}
  (Y^{2n}\mm)_{1,n+1}=\mm_{2n+1,n+1}=-t_n=0.
\end{equation}
Now we claim that
\begin{equation}\label{2n at M 2n+1}
  (M^{2n+1})_{1,n+1}=-\frac{t_{n+1}}{d}.
\end{equation}
For this note that by Lemma~\ref{lema BNL} we have
$$
dM^{2n+1}=\sum_{i=0}^{2n}Y^i \mm Y^{2n-i}+(1-a)Y^{2n+1}+\mm Y^{2n-1}\mm.
$$
But $(Y^{2n+1})_{1,n+1}=0$ and
$$
(\mm Y^{2n-1}\mm)_{1,n+1}=(1,-1)\cdot (\mm_{2n-1,n+1},\mm_{2n,n+1})=-\mm_{2n,n+1}=-t_{n+1}.
$$
So, in order to prove~\eqref{2n at M 2n+1}, it suffices to prove that
$$
\left( \sum_{i=0}^{2n}Y^i \mm Y^{2n-i}\right)_{1,n+1}=0,
$$
which follows readily from the fact that for $i=0,\dots,2n$, we have
\begin{equation}\label{sumando at 1 n+1}
(Y^{i}\mm Y^{2n-i})_{1,n+1}=\mm_{1+i,i+1-n}=\begin{cases}
                                      \mm_{n,0}=d, & \mbox{if } i=n-1 \\
                                      \mm_{n+1,1}=-d, & \mbox{if } i=n \\
                                      \mm_{2n,n}=0, & \mbox{if } i=2n-1 \\
                                      \mm_{2n+1,n+1}=0, & \mbox{if } i=2n \\
                                      0, & \mbox{otherwise}.
                                    \end{cases}
\end{equation}
Next we prove
\begin{equation}\label{2n at M 2n Y}
  (M^{2n}Y)_{1,n+1}=0.
\end{equation}
For this note that by Lemma~\ref{lema BNL} we have
$$
dM^{2n}Y=\sum_{i=0}^{2n-1}Y^i \mm Y^{2n-i}+(1-a)Y^{2n+1},
$$
and so from~\eqref{sumando at 1 n+1} we obtain directly~\eqref{2n at M 2n Y}.
Finally, using Lema~\ref{lema BNL} and~\eqref{sumando at 1 n+1},  we compute
\begin{equation}\label{2n at M n Y n+1}
  (M^{n}Y^{n+1})_{1,n+1}=\sum_{i=0}^{n-1}(Y^i\mm Y^{2n-i})_{1,n+1}+(Y^{2n+1})_{1,n+1}=\mm_{n,0}=d.
\end{equation}
Inserting the values obtained in~\eqref{2n at Y2nM}, \eqref{2n at M 2n+1}, \eqref{2n at M 2n Y} and~\eqref{2n at M n Y n+1} into the
equality~\eqref{matrix equality at 2n} yields
$$
0=t_0\left(-\frac{t_{n+1}}{d}\right)+t_{n+1}d,
$$
from which~\eqref{casos t0} follows directly. By Proposition~\ref{twisting Lr}(3) we know that $t_0\in\{d,d^2\}$. If $t_0=d$, from~\eqref{casos t0}  we obtain $t_{n+1}=0$ and then
$$
0=(\mm^2)_{2n,0}=t_0+t_1
$$
yields $t_1=-d$. This gives one of the desired cases
$$
\mm_{2n,*}=dE_0-dE_1\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-dE_1+a E_{2n+2}.
$$

On the other hand, if $t_0=d^2$, then we claim that
\begin{equation}\label{casos t0 d^2}
t_{n+1}=ad-d-t_1.
\end{equation}
For this we will evaluate the matrix equality~\eqref{matrix equality at 2n}
at $(1,2n+2)$. In our case~\eqref{matrix equality at 2n} reads
\begin{equation}\label{matrix equality at 2n d^2}
 Y^{2n}\mm=d^2 M^{2n+1}+t_1 M^{2n}Y+t_{n+1} M^n Y^{n+1}
\end{equation}
First we compute
\begin{equation}\label{2n at Y2nM d^2}
  (Y^{2n}\mm)_{1,2n+2}=\mm_{2n+1,2n+2}=a.
\end{equation}
Now we claim that
\begin{equation}\label{2n at M 2n+1 d^2}
  d^2(M^{2n+1})_{1,2n+2}=1
\end{equation}
For this note that by Lemma~\ref{lema BNL} we have
$$
d(M^{2n+1})_{1,2n+2}=\sum_{i=0}^{2n}(Y^i \mm Y^{2n-i})_{1,2n+2}+(1-a)(Y^{2n+1})_{1,2n+2}+(\mm Y^{2n-1}\mm)_{1,2n+2}.
$$
But $(Y^{2n+1})_{1,2n+2}=1$ and
$$
(\mm Y^{2n-1}\mm)_{1,2n+2}=(1,-1)\cdot (\mm_{2n-1,2n+2},\mm_{2n,2n+2})=0.
$$
So, in order to prove~\eqref{2n at M 2n+1 d^2}, it suffices to prove that
\begin{equation}\label{suma es 2a}
\left( \sum_{i=0}^{2n}Y^i \mm Y^{2n-i}\right)_{1,2n+2}=2a,
\end{equation}
since then
$$
d^2 (M^{2n+1})_{1,2n+2}=d(2a+(1-a))=d(a+1)=1.
$$
But~\eqref{suma es 2a} follows readily from the fact that for $i=0,\dots,2n$, we have
\begin{equation}\label{sumando at 1 n+1 d^2}
(Y^{i}\mm Y^{2n-i})_{1,2n+2}=\mm_{i+1,i+2}=\begin{cases}
                                      a, & \mbox{if } i\in\{n-1,2n\} \\
                                      0, & \mbox{otherwise}.
                                    \end{cases}
\end{equation}
This establishes~\eqref{2n at M 2n+1 d^2}.
Next we prove
\begin{equation}\label{2n at M 2n Y d^2}
  d(M^{2n}Y)_{1,2n+2}=1.
\end{equation}
For this note that by Lemma~\ref{lema BNL} we have
$$
d(M^{2n}Y)_{1,2n+2}=\sum_{i=0}^{2n-1}(Y^i \mm Y^{2n-i})_{1,2n+2}+(1-a)(Y^{2n+1})_{1,2n+2},
$$
and so from~\eqref{sumando at 1 n+1 d^2} we obtain~\eqref{2n at M 2n Y d^2}.
Finally, using Lema~\ref{lema BNL} and\eqref{sumando at 1 n+1 d^2},  we compute
\begin{equation}\label{2n at M n Y n+1 d^2}
  (M^{n}Y^{n+1})_{1,2n+2}=\sum_{i=0}^{n-1}(Y^i\mm Y^{2n-i})_{1,2n+2}+(Y^{2n+1})_{1,2n+2}=a+1.
\end{equation}
Inserting the values obtained in~\eqref{2n at Y2nM d^2}, \eqref{2n at M 2n+1 d^2}, \eqref{2n at M 2n Y d^2} and~\eqref{2n at M n Y n+1 d^2} into the
equality~\eqref{matrix equality at 2n d^2} yields
$$
a= 1+ \frac{t_1}{d}+t_{n+1}(a+1)
$$
from which~\eqref{casos t0 d^2} follows using $a+1=\frac{1}{d}$. But
$$
0=(\mm^2)_{2n,0}=t_0+t_1+d t_{n+1},
$$
which together with~\eqref{casos t0 d^2} yields
$$
0=d^2+t_1+d(ad-d-t_1)=ad^2+t_1(1-d)=ad^2+t_1 ad,
$$
and so $t_1=-d$ and $t_{n+1}=ad$. This gives the second one of the desired cases
$$
\mm_{2n,*}=d^2 E_0-dE_1+ad E_{n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d^2 E_1-ad E_{n+2}+a E_{2n+2}
$$
and concludes the proof.
\end{proof}

\begin{proposition}\label{BnL 2n}
  If $t_{2n+1}=\mm_{2n,2n+1}=a$, then
$$
\mm_{2n,*}=d^2E_0-dE_1+a E_{2n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d^2 E_1
$$
or
$$
\mm_{2n,*}=d E_0-dE_1-ad E_{n}+a E_{2n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d E_1+ad E_{n+1}.
$$
\end{proposition}

\begin{proof}
By Corollary~\ref{graded condition} we have
\begin{equation}\label{primera estrella}
  Y^{2n}\mm=\sum_{j=0}^n t_j M^{2n+1-j}Y^j+\sum_{j=n+1}^{2n+1} t_j M^{2n+1-j}Y^j.
\end{equation}
By Lemma~\ref{lema BNL} we have
$$
dM^{2n+1}=\mm Y^{2n-1}\mm +\sum_{i=0}^{2n}Y^i\mm Y^{2n-i}+(1-a)Y^{2n+1},
$$
$$
dM^{2n+1-j}Y^j=\sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}+(1-a)Y^{2n+1},\quad\text{for $1\le j\le n$,}
$$
and
$$
M^{2n+1-j}Y^j=\sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}+Y^{2n+1},\quad\text{for $n+1\le j\le 2n$.}
$$
So~\eqref{primera estrella} multiplied by $d$ reads
\begin{align*}
  dY^{2n}\mm= & t_0 \mm Y^{2n-1}\mm +\sum_{j=0}^n t_j \left(\sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}+(1-a)Y^{2n+1}\right)\\
              & +\sum_{j=n+1}^{2n} d t_j \left(\sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}+Y^{2n+1}\right) +d t_{2n+1}Y^{2n+1}
\end{align*}
and if we write ${\hat t}_j=\begin{cases}
                            t_j, & \mbox{if } j\le n \\
                            dt_j, & \mbox{if } n<j\le 2n+1,
                          \end{cases}$\\
and $S_j=\sum_{i=0}^{j}\hat t_j$, then this reads
\begin{equation}\label{intermedio}
  dY^{2n}\mm=  t_0 \mm Y^{2n-1}\mm +\sum_{j=0}^{2n} \hat t_j \sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}+(S_{2n+1}-a S_n)Y^{2n+1}.
\end{equation}

But
$$
\sum_{j=0}^{2n} \hat t_j \sum_{i=0}^{2n-j}Y^i\mm Y^{2n-i}=\sum_{i=0}^{2n}\sum_{j=0}^{2n-i} \hat t_j Y^i\mm Y^{2n-i}
=\hat t_0 Y^{2n}\mm + \sum_{i=1}^{2n}\sum_{j=0}^{i} \hat t_j Y^{2n-i}\mm Y^{i}
$$
and so from~\eqref{intermedio} we obtain
\begin{equation}\label{intermedio 1}
  (d-t_0)Y^{2n}\mm=  t_0 \mm Y^{2n-1}\mm +\sum_{i=1}^{2n} S_i Y^{2n-i}\mm Y^{i}+(S_{2n+1}-a S_n)Y^{2n+1}.
\end{equation}
We will evaluate the matrix equality~\eqref{intermedio 1} at $(1,k)$ for $k=2,\dots,2n+1$.
For $k=2$ we have
$$
(Y^{2n}\mm)_{1,2}=\mm_{2n+1,2}=-t_1-d,\quad (\mm Y^{2n-1}\mm)_{1,2}=(1,-1)\cdot (\mm_{2n-1,2},\mm_{2n,2})=-t_2
$$
and
$$
\sum_{i=1}^{2n} S_i (Y^{2n-i}\mm Y^{i})_{1,2}=S_1 (Y^{2n-1}\mm Y)_{1,2}+S_2 (Y^{2n-2}\mm Y^{2})_{1,2}=S_1 \mm_{2n,1}+S_2 \mm_{2n-1,0}.
$$
Since $(Y^{2n+1})_{1,2}=0$, $\mm_{2n,1}=t_1$ and $\mm_{2n-1,0}=d$, from~\eqref{intermedio 1} we obtain
$$
(d-t_0)(-t_1-d)=t_0(-t_2)+(t_0+t_1)t_1+(t_0+t_1+t_2)d,
$$
which yields
\begin{equation}\label{equation k 2}
  (t_0-d)t_2=(d+t_1)^2.
\end{equation}
For $k=3,\dots,2n+1$ we have $(Y^{2n+1})_{1,k}=0$ and $(Y^{2n}\mm)_{1,k}=\mm_{2n+1,k}=-t_{k-1}$.
Moreover
$$
(\mm Y^{2n-1}\mm)_{1,k}=(1,-1)\cdot (\mm_{2n-1,k},\mm_{2n,k})=-t_k,
$$
and
$$
(Y^{2n-i}\mm Y^i)_{1,k}=\mm_{2n+1-i,k-i}=\begin{cases}
                                           \mm_{2n,k-1}=t_{k-1}, & \mbox{if } i=1 \\
                                           \mm_{2n+2-k,1}, & \mbox{if } i=k-1 \\
                                           \mm_{2n+1-k,0}, & \mbox{if } i=k \\
                                           0, & \mbox{otherwise}.
                                         \end{cases}
$$
Now, for $k=3,\dots,n+1$ we have $\mm_{2n+1-k,0}=d$ and $\mm_{2n+2-k,1}=-d$. So, for
$k=3,\dots,n+1$ the equality~\eqref{intermedio 1} reads
$$
(d-t_0)(-t_{k-1})=-t_0 t_k+S_1 t_{k-1}+S_{k-1}(-d)+S_{k}d,
$$
which yields
$$
0=\hat t_k-t_k t_0+(d+t_1)t_{k-1}.
$$
So we obtain
\begin{equation}\label{equation k hasta n}
  (t_0-d)t_k=(d+t_1)t_{k-1},\quad\text{for $k=3,\dots,n$}
\end{equation}
and
\begin{equation}\label{equation k n+1}
  (t_0-d^2)t_{n+1}=(d+t_1)t_{n}.
\end{equation}
On the other hand, for $k=n+2,\dots,2n+1$ we have $\mm_{2n+1-k,0}=1$ and $\mm_{2n+2-k,1}=-1$,
So, for $k=n+2,\dots,2n$, the equality~\eqref{intermedio 1} reads
$$
(d-t_0)(-t_{k-1})=-t_0 t_k+S_1 t_{k-1}+S_{k-1}(-1)+S_{k},
$$
which yields
$$
0=\hat t_k-t_k t_0+(d+t_1)t_{k-1}=t_k(d-t_0)+(d+t_1)t_{k-1}.
$$
So we obtain
\begin{equation}\label{equation k hasta 2n}
  (t_0-d)t_k=(d+t_1)t_{k-1},\quad\text{for $k=n+1,\dots,2n$.}
\end{equation}
For $k=2n+1$ we obtain
$$
(d-t_0)(-t_{2n})=-t_0 t_{2n+1}+S_1 t_{2n}+S_{2n}(-1),
$$
since $i$ goes only up to $2n=k-1$. Since $t_{2n+1}=a$, we obtain
\begin{equation}\label{equation k 2n+1}
  t_0 a+S_{2n}=(d+t_1)t_{2n}.
\end{equation}
Now we evaluate~\eqref{intermedio 1} at $(k,2n+1+k)$ for $k=1,\dots,n-1$. We will obtain several times entries of the form $\mm_{j,j+1}$
and so we note that by Proposition~\ref{MYM}(2) we have
$$
\mm_{j,j+1}=\begin{cases}
              a, & \mbox{if } j\in\{n,2n\} \\
              0, & \mbox{if } 1\le j\le 3n-1, j\notin\{n,2n\}.
            \end{cases}
$$
Hence $(Y^{2n}\mm)_{k,2n+1+k}=\mm_{2n+k,2n+1+k}=0$ for $k=1,\dots,n-1$, and we also have
$$
(Y^{2n-i}\mm Y^i)_{k,2n+1+k}=\mm_{2n+k-i,2n+1+k-i}=\begin{cases}
                                           a, & \mbox{if } i\in\{k,k+n\} \\
                                           0, & \mbox{otherwise}.
                                         \end{cases}
$$
Since
$$
(\mm Y^{2n-1}\mm)_{k,2n+1+k}=(1,-1)\cdot (\mm_{2n-1,2n+1+k},\mm_{2n,2n+1+k})=0,
$$
and $(Y^{2n+1})_{k,2n+1+k}=1$, from~\eqref{intermedio 1} we obtain
$$
0=(S_k+S_{k+n})a+S_{2n+1}-a S_{n},\quad\text{for $k=1,\dots,n-1$.}
$$
Subtracting the equalities for $k$ and $k-1$ for $k=2,\dots, n-1$ we see that these equalities are equivalent to
\begin{equation}\label{suma 2n+1}
0=(S_1+S_{n+1})a+S_{2n+1}-a S_{n},
\end{equation}
and
\begin{equation}\label{suma k}
0=t_k+dt_{n+k},\quad\text{for $k=2,\dots, n-1$.}
\end{equation}

By Proposition~\ref{twisting Lr}(3) we know that $t_0\in\{d,d^2\}$, and now we assume $t_0=d^2$. We claim that in this case
\begin{equation}\label{t_1 + d=0}
  t_1=-d.
\end{equation}
In fact, if we assume by contradiction that $(t_1+d)\ne 0$, then from~\eqref{equation k n+1} we obtain $t_n=0$ and
from~\eqref{equation k hasta n} for $k=n,n-1,\dots,3$ we obtain successively $t_{n-1}=0$, $t_{n-2}=0$,\dots, $t_{2}=0$. Then~\eqref{equation k 2}
yields the contradiction, which proves~\eqref{t_1 + d=0}.
Now the equalities~\eqref{equation k 2}, \eqref{equation k hasta n} and~\eqref{equation k hasta 2n} yield $t_k=0$ for $k=2,\dots,2n$, $k\ne n+1$. But now~\eqref{equation k 2n+1}
reads
$t_0 a+S_{2n}=0$, and so
$$
0=d^2a+t_0+t_1+dt_{n+1}=d^2(a+1)-d+dt_{n+1}=dt_{n+1},
$$
which implies $t_{n+1}=0$. This gives one of the desired cases
$$
\mm_{2n,*}=d^2E_0-dE_1+a E_{2n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d^2 E_1.
$$
On the other hand, if $t_0=d$, then~\eqref{equation k 2} gives $t_1=-d$ and~\eqref{equation k n+1} gives $t_{n+1}=0$. Adding the equalities~\eqref{suma k} for $k=2,\dots,n-1$ yields
$$
S_{2n}=t_0+t_1+t_n+dt_{n+1}+t_{2n}=t_n+t_{2n},
$$
and so from~\eqref{equation k 2n+1} we obtain $ad+t_n+t_{2n}=0$. We claim that
\begin{equation}\label{f se anula}
  f:=\frac{t_{2n}}{a}=-\frac{t_n}{ad}-1=0.
\end{equation}
Assume by contradiction that $f\ne 0$. Then we evaluate
$$
0=(\mm^2)_{2n,k}=fa \mm_{2n,k}+a \mm_{2n+1,k}=a(ft_{k}-t_{k-1}),\quad\text{for $k=2n,\dots,n+2$}.
$$
It follows that $t_{2n+1-j}=f^j a$ for $j=2n,\dots,n+1$, and so $t_{n+1}=f^na\ne 0$, the desired contradiction which proves~\eqref{f se anula}.

From~\eqref{f se anula} we deduce $t_n=-ad$ and from
$$
0=(\mm^2)_{2n,k}= a \mm_{2n+1,k}=-at_{k-1},\quad\text{for $k=2,\dots,2n+1$, with $k\ne n+1$,}
$$
we deduce $t_k=0$ for $k=2,\dots,2n$ with $k\ne n$. This gives the second one of the desired cases
$$
\mm_{2n,*}=d E_0-dE_1-ad E_{n}+a E_{2n+1}\quad\text{and}\quad \mm_{2n+1,*}=d^2 E_0-d E_1+ad E_{n+1}.
$$
and concludes the proof.
\end{proof}

In the first case of Proposition~\ref{BnL 2n} the first $3n+2$ rows of $\mm$ look as follows:
\setcounter{MaxMatrixCols}{20}
$$
\begin{pmatrix}
  1 & -1 & 0                 & & & & & & & &&&& \\
  \vdots & \vdots & \vdots  & & & & & & & &&&&\\
  1 & -1 & 0                & & & & & & &  &&&&\\
  d & -1 & 0 & \cdots & a & & & & & &&&&\\
  d & -d & 0 &   \cdots     & 0  &  &  &&&&     & & &  \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots &&&&& & &  \\
  d & -d & 0 &  \cdots& 0  &   &       && &  &&&&\\
  d^2 & -d & 0 & \cdots &0 &&\cdots && a & & &  & \\
  d^2 & -d^2 & 0 &   \cdots     & 0  &   &       & & 0&0 &&&& \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots & & \vdots  &&&&\\
  d^2 & -d^2 & 0 &  \cdots& 0  &  &       & & 0&  &&&&\\
  t_0 & t_1 & t_2 & \cdots & t_{n+1} & t_{n+2} & \cdots & & t_{2n+1} & & &\cdots&t_{3n+1}& 0 \\
  d^3 & -t_0 & -d^2-t_1 & \cdots & -t_n & -t_{n+1} & \cdots &  & -t_{2n} & &&\cdots &-t_{3n}& a-t_{3n+1}\\
  d^3 &-d^3& 0&\cdots
\end{pmatrix},
$$
with $t_0\in \{d^2,d^3\}$ and $t_{3n+1}\in\{0,a\}$.
In fact, Proposition~\ref{BnL 2n} determines the first $2n+1$ rows,  the rows $\mm_{k,*}$ for $k=2n+2,\dots,3n-1$ follow from the
equality $0=(\mm Y^j\mm)_{n,i}=0$ for $j=n+1,\dots,2n-2$ and $i\ge 0$, the rows $\mm_{3n,*}$ and $\mm_{3n+1,*}$ from Proposition~\ref{twisting Lr}
and the last row from $0=(\mm Y^{2n+1}\mm)_{n,i}=0$ for $i\ge 0$.

Similarly in the first case of Proposition~\ref{BnL 2n+1}  the first $3n+2$ rows of $\mm$ look as follows:
\setcounter{MaxMatrixCols}{20}
$$
\begin{pmatrix}
  1 & -1 & 0                 & & & & & & & &&&& \\
  \vdots & \vdots & \vdots  & & & & & & & &&&&\\
  1 & -1 & 0                & & & & & & &  &&&&\\
  d & -1 & 0 & \cdots & a & & & & & &&&&\\
  d & -d & 0 &   \cdots     & 0  &  &  &&&&     & & &  \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots &&&&& & &  \\
  d & -d & 0 &  \cdots& 0  &   &       && &  &&&&\\
  d & -d & 0 & \cdots &0 &&\cdots && 0 & & &  & \\
  d^2 & -d & 0 &   \cdots     & 0  &  &       & & 0&a &&&& \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots & & \vdots  &&&&\\
  d^2 & -d^2 & 0 &  \cdots& 0  &  &       & & 0&  &&&&\\
  d^2 & -d^2 & 0 &  \cdots& 0  &  &       & & 0&  &&&&\\
  t_0 & t_1 & t_2 & \cdots & t_{n+1} & t_{n+2} & \cdots & & t_{2n+1} & & &\cdots&t_{3n+2}& 0 \\
  d^3 & -t_0 & -d^2-t_1 & \cdots & -t_n & -t_{n+1} & \cdots &  & -t_{2n} & &&\cdots &-t_{3n+1}& a-t_{3n+2}
\end{pmatrix},
$$
with $t_0\in \{d^2,d^3\}$ and $t_{3n+2}\in\{0,a\}$. In fact, Proposition~\ref{BnL 2n+1} determines the first $2n+1$ rows,  the rows $\mm_{k,*}$ for $k=2n+2,\dots,3n$ follow from the
equality $0=(\mm Y^j\mm)_{n,i}=0$ for $j=n+1,\dots,2n-1$ and $i\ge 0$ and the rows $\mm_{3n,*}$ and $\mm_{3n+1,*}$ from Proposition~\ref{twisting Lr}.

In the second case of Proposition~\ref{BnL 2n+1}  the first $3n+2$ rows of $\mm$ look as follows:
\setcounter{MaxMatrixCols}{20}
$$
\begin{pmatrix}
  1 & -1 & 0                 & & & & & & & &&&& \\
  \vdots & \vdots & \vdots  & & & & & & & &&&&\\
  1 & -1 & 0                & & & & & & &  &&&&\\
  d & -1 & 0 & \cdots & a & & & & & &&&&\\
  d & -d & 0 &   \cdots     & 0  &  &  &&&&     & & &  \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots &&&&& & &  \\
  d & -d & 0 &  \cdots& 0 &   &       && &  &&&&\\
  d^2 & -d & 0 & \cdots &ad &&\cdots && 0 & & &  & \\
  d^2 & -d^2 & 0 &   \cdots     & 0  &-ad  &       & & 0&a &&&& \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots & & \vdots  &&&&\\
  d^2 & -d^2 & 0 &  \cdots& 0  &  &       & & 0&  &&&&\\
  d^3 & -d^2 & 0 &  \cdots& ad^2  &  &       & & 0&  &&&&\\
  t_0 & t_1 & t_2 & \cdots & t_{n+1} & t_{n+2} && \cdots &  t_{2n+1} & & &\cdots&t_{3n+2}& 0 \\
  d^3 & -t_0 & u & \cdots & -t_n & -t_{n+1} &v& \cdots   & -t_{2n} & &&\cdots &-t_{3n+1}& a-t_{3n+2}
\end{pmatrix},
$$
where $u=-d^3-t_1$ and $v=-t_{n+2}-ad^2$. Here we also have four choices corresponding to $t_0\in \{d^2,d^3\}$ and $t_{3n+2}\in\{0,a\}$.
As before, Proposition~\ref{BnL 2n+1} determines the first $2n+1$ rows and  the rows $\mm_{k,*}$ for $k=2n+2,\dots,3n$ follow from the
equality $0=(\mm Y^j\mm)_{n,i}=0$ for $j=n+1,\dots,2n-1$ and $i\ge 0$. The last two rows can be computed as in the proof of Proposition~\ref{twisting Lr}.

In the second case of Proposition~\ref{BnL 2n} the first $3n+2$ rows of $\mm$ look as follows:
\setcounter{MaxMatrixCols}{20}
$$
\begin{pmatrix}
  1 & -1 & 0                 & & & & & & & &&&& \\
  \vdots & \vdots & \vdots  & & & & & & & &&&&\\
  1 & -1 & 0                & & & & & & &  &&&&\\
  d & -1 & 0 & \cdots & 0&a & & & & & &&&&\\
  d & -d & 0 &   \cdots     & 0  &0  &  &&&&     & & &  \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots &&&&& & &  \\
  d & -d & 0 &  \cdots& 0  &  0 &       && &  &&&&\\
  d & -d & 0 & \cdots &-ad &0&\cdots && a & & &  & \\
  d^2 & -d & 0 &   \cdots     & 0  & ad  &       & & 0&&0 &&& \\
  \vdots & \vdots & \vdots & & \vdots  &   &\ddots & & \vdots  &&&&\\
  d^2 & -d^2 & 0 &  \cdots& 0  &  &       & & 0&  &&&&\\
  t_0 & t_1 & t_2 & \cdots & t_{n} & t_{n+1} & \cdots & & t_{2n+1} &  &\cdots&&t_{3n+1}& 0 \\
  d^3 & -t_0 & u & \cdots & v & -t_{n} & \cdots &  & -t_{2n} & &\cdots &&-t_{3n}& a-t_{3n+1}\\
  d^3 &-d^2& 0&\cdots&0& ad^2&    \cdots   & & 0&& \cdots &&0&0
\end{pmatrix},
$$
where $u=-d^2-t_1$, $v=-t_{n-1}-ad^2$ and $\mm_{3n+1,k}=-t_{k-1}$ for all entries not shown in the matrix.
Here we also have four choices corresponding to $t_0\in \{d^2,d^3\}$ and $t_{3n+1}\in\{0,a\}$.
As before, Proposition~\ref{BnL 2n} determines the first $2n+1$ rows,  the rows $\mm_{k,*}$ for $k=2n+2,\dots,3n-1$ follow from the
equality $0=(\mm Y^j\mm)_{n,i}=0$ for $j=n+1,\dots,2n-2$ and $i\ge 0$, the rows $\mm_{3n,*}$ and $\mm_{3n+1,*}$  can be computed as in the proof of Proposition~\ref{twisting Lr}
and the last row follows from $0=(\mm Y^{2n+1}\mm)_{n,i}=0$ for $i\ge 0$.

Each of the four matrices in turn gives us again four possibilities, solving a similar system as in Propositions~\ref{BnL 2n} and~\ref{BnL 2n+1}. So we have 16 cases. However,
the system of equations are more involved, specially in the last two matrices. Proposition~\ref{twisting Lr} can be adapted to these two last matrices,
but not Lemma~\ref{lema BNL}. This lemma expresses the powers of $M$
in terms of $Y^k\mm Y^j$, which is the key to obtaining the systems of equations. However this lemma applies only to the first two cases.
So our methods don't provide a complete classification.
In particular, there are restrictions that prevent that all cases can be realized in a twisting map. Some of these restrictions will be seen in the next section,
where we will describe a family of twisting maps for which Lemma~\ref{lema BNL} applies.

\section{The family $B(n,L)$ and quasi-balanced sequences}\label{seccion familia}
In this section we will describe a family of twisted tensor products that arise in the case~(2) of Proposition~\ref{clasificacion}.
So $\sigma$ is a twisting map and $Y$ and $M$ are as in Corollary~\ref{graded condition} and $\mm=M-Y$.
Moreover $n\in\mathds{N}$ with $n\ge 2$, $\mm_{k*}=\mm_{0*}$ for $1< k< n$ and
$\mm_{n,*}=d E_0-E_1+a E_{n+1}$ with $d(a+1)=1$.

By Proposition~\ref{condiciones para BnL}(3), the twisting map defines a sequence $L=(L_1,L_2,\dots)$ such that $\mm_{L_i,L_i+1}=a$ and such that $\mm_{k,k+1}=0$ if $L_i<k<L_{i+1}$ for some $i$.
Moreover $L_{j+1}-L_j\in\{n,n+1\}$ for all $j>1$, so $L$ belongs to the set of sequences
$$
\Delta(n,n+1)=\{L\in\mathds{N}^{\mathds{N}}\ :\ L_1=n\text{ and }L_{j+1}-L_j\in\{n,n+1\}\text{ for all $j>1$}\}.
$$
Motivated by the first cases of Propositions~\ref{BnL 2n+1} and~\ref{BnL 2n}, and as a continuation of these two cases, for a given sequence $L\in \Delta(n,n+1)$ we define
the infinite matrix
$$
M(L):=\begin{cases}
                E_0-E_1, & \mbox{if } j<L_1 \\
            d^k (E_0-E_1), & \mbox{if } L_k<j<L_{k+1} \\
            d^k E_0- d^{k-1}E_1+a E_{L_k+1}, & \mbox{if $j=L_k$}
          \end{cases}.
$$
It turns out (Theorem~\ref{teorema familia BnL})
 that setting $\mm:=M(L)$ defines a twisting map if and only if  $L\in\mathcal{L}$, where the set of sequences $\mathcal{L}$ is defined as follows:
$$
\mathcal{L}:= \{L\in\Delta(n,n+1),\ L_{r}-1\le L_j+L_{r-j}\le L_{r}\text{ for all $0<j<r$}\}.
$$
So we will describe some properties of the sequences in $\mathcal{L}$, which we call quasi-balanced sequences.

\begin{definition}\label{Def quasi balanced}
We say that a sequence $L\in\Delta(n,n+1)$ is $r$-balanced, if $L_{r}=L_j+L_{r-j}$ for all $0<j<r$. We say that
the sequence is $r$-quasi-balanced, if $L_{r}-1\le L_j+L_{r-j}\le L_{r}$ for all $0<j<r$. We also say that a finite sequence
$(L_1,\dots,L_{r_0})$ is quasi-balanced, if $L_{r}-1\le L_j+L_{r-j}\le L_{r}$ for all $0<j<r\le r_0$.
\end{definition}
Note that every sequence $L\in\Delta(n,n+1)$ is trivially $1$-balanced, and it is also easy to see that
it is $2$-quasi-balanced and $3$-quasi-balanced. However the sequences beginning with
$(n,2n,3n+1,4n+2,\dots)$ or $(n,2n+1,3n+1,4n+1,\dots)$ are not $4$-quasi-balanced.

 Clearly a sequence
$L\in\Delta(n,n+1)$ is quasi-balanced (i.e. belongs to $\mathcal{L}$), if and only if it is $r$-quasi-balanced for all $r$, if and only if all
the sequences $L_{\le r}:=(L_1,\dots,L_r)$ are quasi-balanced.
For a given sequence $L$ and  $0<j<r $ we define $\Delta_{r,j}:=L_r-L_j-L_{r-j}$. The fact that $(L_1,\dots,L_{r_0})$ is quasi-balanced
is equivalent to the fact that $\Delta_{r,j}\in \{0,1\}$ for all $0<j<r\le r_0$.
\begin{proposition}\label{continuar balanceado}
Assume that the finite sequence $(L_1,\dots,L_{r_0})$ is quasi-balanced. Then either
$(L_1,\dots,L_{r_0},L_{r_0}+n)$ is quasi-balanced or $(L_1,\dots,L_{r_0},L_{r_0}+n+1)$ is quasi-balanced.
\end{proposition}

\begin{proof}
We want to prove that either
$$
\Delta^{-}_{r_0+1,j}:=L_{r_0}+n-L_j-L_{r_0+1-j}\in\{0,1\}\ \text{for all $0<j<r_0+1$}
$$
or that
$$
\Delta^{+}_{r_0+1,j}:=L_{r_0}+n+1-L_j-L_{r_0+1-j}\in\{0,1\}\ \text{for all $0<j<r_0+1$}.
$$
Clearly $\Delta^{+}_{r_0+1,j}=\Delta^{-}_{r_0+1,j}+1$ and moreover
$$
\Delta^{-}_{r_0+1,j}:=\Delta_{r_0,j}+n-(L_{r_0+1-j}- L_{r_0-j})\in\{\Delta_{r_0,j},\Delta_{r_0,j}-1\}=\{-1,0,1\},
$$
hence $\Delta^{+}_{r_0+1,j}\in\{0,1,2\}$.

In order to finish the proof it suffices to prove that
\begin{equation}\label{implicacion}
\exists j_0\text{ s.t. }\Delta^{-}_{r_0+1,j}=-1 \ \Rightarrow \ \forall j_1, \ \Delta^{+}_{r_0+1,j}\in\{0,1\}
\end{equation}
Now assume by contradiction that there exist $j_0,j_1$ such that $\Delta^{-}_{r_0+1,j_0}=-1$ and such that $\Delta^{+}_{r_0+1,j_1}=2$, i.e.,
 $\Delta^{-}_{r_0+1,j_1}=1$. We can assume that $j_1>j_0$ since $\Delta^{-}_{r_0+1,j}=\Delta^{-}_{r_0+1,r_0+1-j}$.
Now we set $s:=j_1-j_0=(r_0+1-j_0)-(r_0+1-j_1)>0$ and obtain
\begin{eqnarray*}
  2 &=& \Delta^{-}_{r_0+1,j_1}-\Delta^{-}_{r_0+1,j_0} \\
   &=& -L_{r_0+1-j_1}- L_{j_1}+L_{r_0+1-j_0}+ L_{j_0}+L_s-L_s \\
   &=& L_{r_0+1-j_0}-L_s-L_{r_0+1-j_1}-(L_{j_1}-L_{j_0}-L_s) \\
   &=&  \Delta(r+1-j_0,s)- \Delta(j_1,s).
\end{eqnarray*}
But $\Delta(r+1-j_0,s), \Delta(j_1,s)\in\{0,1\}$, so we obtain a contradiction which establishes~\eqref{implicacion}
and concludes the proof.
\end{proof}

\begin{corollary}
If $\tilde L=(L_1,\dots,L_r)$ is quasi-balanced, then there exists $L\in\mathcal{L}$ such that $L_{\le r}=\tilde L$.
\end{corollary}

\begin{proof}
Construct inductively $L_{r+1}$, $L_{r+2}$,\dots using Proposition~\ref{continuar balanceado}.
\end{proof}

\begin{lemma}\label{no hay twisting}
If $L\in \Delta(n,n+1)$, but $L\notin\mathcal{L}$, then there exists $k,r\in\mathds{N}$ such that either
\begin{enumerate}
  \item $L_{k+r}=L_k+L_r-1$ and $L_{r-1}+2<L_r$ or
  \item $L_{k+r}=L_k+L_r+2$ and $L_r+2<L_{r+1}$.
\end{enumerate}
\end{lemma}
\begin{proof}
Let $m:=\min\{j: \ L_{\le j}\text{ is not quasi-balanced}\}$. Then
$$
\Delta_{m,j}=\Delta_{m-1,j}+(L_{m}-L_{m-1})-(L_{m-j}-L_{m-j-1}).
$$
Since $\Delta_{m-1,j}\in\{0,1\}$, $(L_{m}-L_{m-1})\in\{n,n+1\}$ and $(L_{m-j}-L_{m-j-1})\in\{n,n+1\}$ necessarily
$\Delta_{m,j}\in\{-1,0,1,2\}$. But $L_{\le m}$ is not quasi-balanced, so there exists $j$ such that either $\Delta_{m,j}=-1$ or $\Delta_{m,j}=2$.
In the case $\Delta_{m,j}=-1$ set $r:=\min\{j:\ \Delta_{m,j}=-1\}$ and $k:=m-r$. Then $\Delta_{m,r-1}=0$, since
$|\Delta_{m,r}-\Delta_{m,r-1}|\le 1$.
But
$$
\Delta_{m,r-1}=\Delta_{m,r}+(L_{r}-L_{r-1})-(L_{m-r+1}-L_{m-r}),
$$
hence $0=-1+(L_{r}-L_{r-1})-(L_{m-r+1}-L_{m-r})$, and since $(L_{r}-L_{r-1}),(L_{m-r+1}-L_{m-r})\in\{n,n+1\}$, we have
 $L_{r}-L_{r-1}=n+1$ and $L_{m-r+1}-L_{m-r}=n$. So $L_{r}-L_{r-1}=n+1>2$ and together with $\Delta_{k+r,r}=L_{k+r}-L_k-L_r=-1$ this proves~(1).

On the other hand, in the case $\Delta_{m,j}=2$ set $r:=\max\{j:\ \Delta_{m,j}=2\}$ and $k:=m-r$. Then $\Delta_{m,r+1}=1$, since
$|\Delta_{m,r}-\Delta_{m,r+1}|\le 1$.
But
$$
\Delta_{m,r+1}=\Delta_{m,r}+(L_{m-r}-L_{m-r-1})-(L_{r+1}-L_{r}),
$$
hence $1=2+(L_{m-r}-L_{m-r-1})-(L_{r+1}-L_{r})$, and since $(L_{m-r}-L_{m-r-1}),(L_{r+1}-L_{r})\in\{n,n+1\}$, we have
 $(L_{r+1}-L_{r})=n+1$ and $L_{m-r}-L_{m-r-1}=n$. So $L_{r+1}-L_{r}=n+1>2$ and together with $\Delta_{k+r,r}=L_{k+r}-L_k-L_r=2$ this yields~(2) and concludes the proof.
\end{proof}

\begin{proposition}\label{LL es necesario para BnL}
Let $L\in \Delta(n,n+1)\setminus\mathcal{L}$, then $M=\mm+Y=M(L)+Y$ doesn't define a twisting map via Corollary~\ref{graded condition}.
\end{proposition}

\begin{proof}
Assume by contradiction that $\mm=M(L)$ defines a twisting map. In the first case of Lemma~\ref{no hay twisting} note that
$L_{r-1}<L_r-2<L_r-1<L_r$, hence by definition $\mm_{L_r-2,*}=\mm_{L_r-2,*}=d^{r-1}(E_0-E_1)$, and so, by Lemma~\ref{mixtos}(1) we have $\mm Y^{L_r-2}\mm=0$. But
then, using that $L_{k+r}=L_k+L_r-1$ and that $a,d,1-d\ne 0$ we obtain
\begin{eqnarray*}
  0=(\mm Y^{L_r-2}\mm)_{L_k,0} &=& d^k \mm_{L_r-2,0}-d^{k-1} \mm_{L_r-1,0}+a \mm_{L_k+L_r-1,0}\\
  &=& d^{k+r-1}-d^{k+r-2}+a d^{k+r}\\
   &=& d^{r+k-2}(d-1+ad^2)= d^{r+k-2}(-ad+ad^2)\\
   &=&-ad^{k+r-1}(1-d)\ne 0,
\end{eqnarray*}
a contradiction which discards this case. On the other hand, in the second case of Lemma~\ref{no hay twisting} note that
$L_{r}<L_r+1<L_r+2<L_{r+1}$, hence by definition $\mm_{L_r+1,*}=\mm_{L_r+2,*}=d^{r}(E_0-E_1)$, and so, by Lemma~\ref{mixtos}(1) we have $\mm Y^{L_r+1}\mm=0$. But
then
$$
0=(\mm Y^{L_r+1}\mm)_{L_k,L_{r+k}+1}=d^k \mm_{L_r+1,L_{r+k}+1}-d^{k-1} \mm_{L_r+2,L_{r+k}+1}+a \mm_{L_k+1+L_r+1,L_{r+k}+1}.
$$
But $\mm_{L_r+1,L_{r+k}+1}=0= \mm_{L_r+2,L_{r+k}+1}$ and $L_{k+r}=L_k+L_r+2$, and so we arrive at
$$
0= a  \mm_{L_{r+k},L_{r+k}+1}=a^2\ne 0,
$$
a contradiction that discards the second case of Lemma~\ref{no hay twisting} and concludes the proof.
\end{proof}

\begin{theorem}\label{teorema familia BnL}
Let $L\in \Delta(n,n+1)$. Then $\mm=M(L)$ defines a twisting map  via Corollary~\ref{graded condition}, setting $M:=\mm+Y$,
if and only if $L\in\mathcal{L}$.
\end{theorem}

\begin{proof}
Proposition~\ref{LL es necesario para BnL} proves that $L\in\mathcal{L}$ is necessary. That it is also sufficient, requires a very lengthy computation, which we relegate to the appendix.
\end{proof}

\begin{remark}
The proof of Theorem~\ref{teorema familia BnL} shows the limitation of our method in order to obtain a complete classification. On one hand
the approach of equalities of infinite matrices yields conditions that reduce the possibilities to very few families. On the other hand
proving that a given infinite matrix yields a twisting map requires to verify an infinite number of matrix equalities for infinite matrices. This is a lengthy
 computation that we were able to realize in Corollary~\ref{Corolario anda}. In that case we only had to prove one of the equalities, since those twisting maps have the $n$-extension property, i.e., they
are completely determined by the values of $\mm_{k,*}$ for $k\le n$. However, in the present case the twisting maps have not the $n$-extension property and
 none of the twisting maps constructed in Theorem~\ref{teorema familia BnL} has the $m$-extension property for any $m$. This is a direct consequence of the
 following property of quasi-balanced sequences:

 Let $(L_1,\dots,L_r)$ be a quasi-balanced partial sequence. Then there exists an extension $(L_1,\dots,L_r,\dots,L_{r+k})$ such that
both
$$
(L_1,\dots,L_r,\dots,L_{r+k},L_{r+k}+n)\quad\text{and}\quad (L_1,\dots,L_r,\dots,L_{r+k},L_{r+k}+n+1)
$$
are quasi-balanced partial sequences.
\end{remark}

In a forthcoming article this property will be proven, together with several other properties of these sequences. For example,
the quasi-balanced sequences show a surprising connection to Euler's totient function and so they are interesting on its own.

\begin{bibdiv}
\begin{biblist}

\bib{A}{article}{
author={Arce, Jack},
   title={Representations of twisted tensor products},
   eprint={	arXiv:1505.01232  [math.RA]},
   }

\bib{AGGV}{article}{
author={Arce, Jack},
author={Guccione, Jorge Alberto},
author={Guccione, Juan Jos\'e},
author={Valqui, Christian},
   title={Twisted Tensor Products of $K^n$ with $K^m$},
   eprint={	arXiv:1603.01222 [math.RA]},
   }

\bib{CSV}{article}{
   author={Cap, Andreas},
   author={Schichl, Hermann},
   author={Van{\v{z}}ura, Ji{\v{r}}{\'{\i}}},
   title={On twisted tensor products of algebras},
   journal={Comm. Algebra},
   volume={23},
   date={1995},
   number={12},
   pages={4701--4735},
   issn={0092-7872},
   review={\MR{1352565}},
   doi={10.1080/00927879508825496},
}

\bib{C}{article}{
   author={Cibils, Claude},
   title={Non-commutative duplicates of finite sets},
   journal={J. Algebra Appl.},
   volume={5},
   date={2006},
   number={3},
   pages={361--377},
   issn={0219-4988},
   review={\MR{2235816}},
   doi={10.1142/S0219498806001776},
}

\bib{CG}{article}{
   author={Conner, Andrew},
   author={Goetz, Peter},
   title={The Koszul property for graded twisted tensor products},
   journal={J. Algebra},
   volume={513},
   date={2018},
   pages={50--90},
   issn={0021-8693},
   review={\MR{3849878}},
   doi={10.1016/j.jalgebra.2018.07.030},
}

\bib{CG2}{article}{
   author={Conner, Andrew},
   author={Goetz, Peter},
   title={Classification, Koszulity and Artin-Schelter Regularity of some Graded Twisted Tensor Products},
   eprint={	arXiv:1811.10069   [math.QA]},
}

\bib{GGV1}{article}{
   author={Guccione, Jorge A.},
   author={Guccione, Juan J.},
   author={Valqui, Christian},
   title={Twisted planes},
   journal={Comm. Algebra},
   volume={38},
   date={2010},
   number={5},
   pages={1930--1956},
   issn={0092-7872},
   review={\MR{2642035}},
   doi={10.1080/00927870903023105},
}

\bib{GGV2}{article}{
   author={Guccione, Jorge A.},
   author={Guccione, Juan J.},
   author={Valqui, Christian},
   title={Non commutative truncated polynomial extensions},
   journal={J. Pure Appl. Algebra},
   volume={216},
   date={2012},
   number={11},
   pages={2315--2337},
   issn={0022-4049},
   review={\MR{2927170}},
   doi={10.1016/j.jpaa.2012.01.021},
}

\bib{JLNS}{article}{
   author={Jara, P.},
   author={L{\'o}pez Pe{\~n}a, J.},
   author={Navarro, G.},
   author={{\c{S}}tefan, D.},
   title={On the classification of twisting maps between $K^n$ and $K^m$},
   journal={Algebr. Represent. Theory},
   volume={14},
   date={2011},
   number={5},
   pages={869--895},
   issn={1386-923X},
   review={\MR{2832263}},
   doi={10.1007/s10468-010-9222-x},
}

\bib{LN}{article}{
   author={L{\'o}pez Pe{\~n}a, Javier},
   author={Navarro, Gabriel},
   title={On the classification and properties of noncommutative duplicates},
   journal={$K$-Theory},
   volume={38},
   date={2008},
   number={2},
   pages={223--234},
   issn={0920-3036},
   review={\MR{2366562}},
   doi={10.1007/s10977-007-9017-y},
}

\end{biblist}
\end{bibdiv}

\newpage

\section*{Appendix}
\renewcommand{\thesection}{A}
In this appendix we will verify that any quasi-balanced sequence yields a twisting map. So we have to verify an infinite number of matrix equalities
which we divide in a few cases. In the other cases of Propositions~\ref{BnL 2n+1} and~\ref{BnL 2n} there are more cases to consider. Moreover, Proposition~\ref{twisting Lr} and Lemma~\ref{lema BNL}
do not hold in those other cases.
\begin{lemma}\label{lema conditions to prove BNL}
Let  $a\in K\setminus\{0,-1\}$ and $L\in\Delta(n,n+1)$, and let $\mm$ be the matrix defined by
$$
\mm_{j,*}=\begin{cases}
                E_0-E_1, & \mbox{if } j<L_1 \\
            d^k (E_0-E_1), & \mbox{if } L_k<j<L_{k+1} \\
            d^k E_0- d^{k-1}E_1+a E_{L_k+1}, & \mbox{if $j=L_k$},
          \end{cases}
$$
where $d=\frac{1}{a+1}$. Let $M=\mm+Y$. Then $M$ defines a twisting map, if and only if
\begin{equation}\label{ecuacion principal}
  Y^k\mm=\sum_{j=0}^{k+1}\mm_{kj}M^{k+1-j}Y^j\quad\text{for all $k\in\mathds{N}$,}
\end{equation}
if and only if the following equalities are satisfied
\begin{enumerate}
  \item $\mm Y^{k}\mm=0$ for $k\in \mathds{N}_0$ with $k,k+1\ne L_t$ for any $t$,
  \item $\mm Y^{L_r}\mm+Y\mm Y^{L_r-1}\mm=a Y^{L_r+1}\mm$ for all $r\in\mathds{N}$,
  \item $\mm Y^{L_r-1}\mm=a\sum_{i=0}^{L_r}Y^i\mm Y^{L_r-i}-ra^2Y^{L_r+1}$ for all $r\in\mathds{N}$.
\end{enumerate}
\end{lemma}

\begin{proof}
By Corollary~\ref{graded condition} the first two conditions are equivalent, since clearly $M_{0j}=\delta_{0j}$ and $M_{kj}=0$ for $j>k+1$.
Now assume that~\eqref{ecuacion principal} holds. From Lemma~\ref{mixtos} we obtain items~(1) and~(2). In order to obtain item~(3), we multiply the equality
$$
Y^{L_r-1}\mm=d^{r-1}M^{L_r-1}\mm
$$
by $M=\mm+Y$ from the left and obtain
$$
Y^{L_r}\mm+\mm Y^{L_r-1}\mm=d^{r-1}M^{L_r}\mm=d^{r-1}M^{L_r+1}-d^{r-1}M^{L_r}Y.
$$
Since $Y^{L_r}\mm=d^r M^{L_r+1}-d^{r-1}M^{L_r}Y+a Y^{L_r+1}$, this yields
$$
\mm Y^{L_r-1}\mm=d^{r-1}M^{L_r+1}-d^{r}M^{L_r+1}-a Y^{L_r+1}.
$$
But $d^{r-1}-d_r=ad^r$ and by Lemma~\ref{lema BNL} we have
$$
d^r M^{L_r+1}=\sum_{i=0}^{L_r}Y^i \mm Y^{L_r-i}+(1-ra)Y^{L_r+1},
$$
hence we obtain
$$
\mm Y^{L_r-1}\mm=a\left(\sum_{i=0}^{L_r}Y^i \mm Y^{L_r-i}+(1-ra)Y^{L_r+1}\right) -a Y^{L_r+1},
$$
from which~(3) follows immediately.

Assume now that~(1), (2) and~(3) hold. From~(1) we obtain
$$
M Y^{k}\mm=\mm Y^k \mm+Y^{k+1}\mm =Y^{k+1}\mm\quad\text{for $k<n-1$ or $L_r<k<L_{r+1}-1$ for some $r$.}
$$
Hence, if $Y^k\mm=d^r M^k\mm$, then $Y^{k+1}\mm=d^r M^{k+1}\mm$ for such $k$. But $Y^0\mm=d^r M^0\mm$, so inductively we obtain
$$
Y^k\mm=M^k\mm \quad\text{for $k<n-1$,}
$$
which proves~\eqref{ecuacion principal} for $k=1,\dots,k-1$.
Multiplying $Y^{n-1}\mm= M^{n-1}\mm$ by $M^2=\mm Y+Y\mm+Y^2$ from the left we obtain
$$
M^{n+1}\mm=\mm Y^{n}\mm+Y \mm Y^{n-1}\mm+Y^{n+1}\mm
$$
and combined with $\mm Y^{n}\mm+Y \mm Y^{n-1}\mm=a Y^{n+1}\mm$ which holds by~(2), this yields
$$
M^{n+1}\mm=(a+1)Y^{n+1}\mm.
$$
Using $(a+1)d=1$ this gives $Y^{n+1}\mm=d M^{n+1}\mm$, which is~\eqref{ecuacion principal} for $k=n+1$.
By the argument above, we obtain $Y^k\mm=d M^k\mm$ for $k=n+1,\dots,L_2-1$, which is~\eqref{ecuacion principal} for such $k$.
Multiplying $Y^{L_2-1}\mm=d M^{L_2-1}\mm$ by $M^2=\mm Y+Y\mm+Y^2$ from the left we obtain
$$
dM^{L_2+1}\mm=\mm Y^{L_2}\mm+Y \mm Y^{L_2-1}\mm+Y^{L_2+1}\mm
$$
and combined with $\mm Y^{L_2}\mm+Y \mm Y^{L_2-1}\mm=a Y^{L_2+1}\mm$ which holds by~(2), this yields
$$
dM^{L_2+1}\mm=(a+1)Y^{L_2+1}\mm.
$$
Using $(a+1)d=1$ this gives $Y^{L_2+1}\mm=d^2 M^{L_2+1}\mm$, which is~\eqref{ecuacion principal} for $k=L_2+1$.
Repeating inductively these arguments we obtain~\eqref{ecuacion principal} for all $k$ which are not some $L_r$.

Now we prove~\eqref{ecuacion principal} for $k=n$. For this we expand $M^{n+1}=(\mm+Y)^{n+1}$, noting that by~(1)
the only term with two times the factor $\mm$ is $\mm Y^{n-1}\mm$:
$$
M^{n+1}=Y^{n+1}+\mm Y^{n-1}\mm+\sum_{i=0}^n Y^i \mm Y^{n-i}.
$$
Using~(3) we obtain
\begin{eqnarray*}
M^{n+1}&=&Y^{n+1}+\left(a\sum_{i=0}^n Y^i \mm Y^{n-i}-a^2 Y^{n+1}\right)+\sum_{i=0}^n Y^i \mm Y^{n-i}\\
&=& (a+1)\sum_{i=0}^n Y^i \mm Y^{n-i}+(a+1)(1-a)Y^{n+1},
\end{eqnarray*}
and multiplying by $d=\frac{1}{a+1}$ we have
\begin{equation}\label{potencia limpia}
dM^{n+1}=\sum_{i=0}^n Y^i \mm Y^{n-i}+(1-a)Y^{n+1}.
\end{equation}
Now  we expand $M^n=(\mm+Y)^n$ noting that by~(1) no term can have two times the factor $\mm$:
$$
M^{n}=Y^{n}+\sum_{i=0}^{n-1} Y^i \mm Y^{n-1-i},
$$
and so
$$
M^{n}Y=Y^{n+1}+\sum_{i=0}^{n-1} Y^i \mm Y^{n-i}.
$$
Together with~\eqref{potencia limpia} this yields
$$
dM^{n+1}-M^nY=Y^n\mm-aY,
$$
which is~\eqref{ecuacion principal} for $k=n$, as desired.
Now assume that~\eqref{ecuacion principal} is satisfied for $k<L_r$. Note that the proof of Lemma~\ref{lema BNL}
only uses that~\eqref{ecuacion principal} is satisfied for $k\le j$, so  by the same argument as in the proof of Lemma~\ref{lema BNL}
we have
\begin{equation}\label{potencia Lr}
 d^{r-1} M^{L_r}=\sum_{i=0}^{L_r-1}Y^i \mm Y^{L_r-1-i}+(1-(r-1)a)Y^{L_r}.
\end{equation}
Multiplying this by $M=Y+\mm$ we obtain
\begin{eqnarray*}
  d^{r-1} M^{L_r+1}&=&\sum_{i=0}^{L_r-1}Y^{i} \mm Y^{L_r-i}+(1-(r-1)a)Y^{L_r+1}\\
  && +(1-(r-1)a) Y^{L_r}\mm +\sum_{i=0}^{L_r-1} Y^i \mm Y^{L_r-1-i}\mm.
\end{eqnarray*}
Using~(1) and (2) by the same argument as in the proof of Lemma~\ref{lema BNL} we obtain
$$
\sum_{i=0}^{L_r-1} Y^i \mm Y^{L_r-1-i}\mm=(r-1)a Y^{L_r}\mm+\mm Y^{L_r-1}\mm
$$
and so
$$
 d^{r-1} M^{L_r+1}=\sum_{i=0}^{L_r}Y^{i} \mm Y^{L_r-i}+(1-(r-1)a)Y^{L_r+1}+\mm Y^{L_r-1}\mm.
$$
From~(3) it follows that
\begin{eqnarray*}
 d^{r-1} M^{L_r+1} &=&\sum_{i=0}^{L_r}Y^{i} \mm Y^{L_r-i}+(1-(r-1)a)Y^{L_r+1} \\
   && +a\sum_{i=0}^{L_r}Y^{i} \mm Y^{L_r-i}-ra^2 Y^{L_r+1} \\
   &=&  (a+1)\sum_{i=0}^{L_r}Y^{i} \mm Y^{L_r-i}+(1+a)(1-ra) Y^{L_r+1},
\end{eqnarray*}
and multiplying by $d$ we have
$$
d^{r} M^{L_r+1}=\sum_{i=0}^{L_r}Y^{i} \mm Y^{L_r-i}+(1-ra) Y^{L_r+1}.
$$
Together with~\eqref{potencia Lr} this yields
$$
d^r M^{L_r+1}-d^{r-1}M^{L_r}Y=Y^{L_r}\mm-a Y^{L_r+1},
$$
which is~\eqref{ecuacion principal} for $k=L_r$. This completes the inductive step and concludes the proof.
\end{proof}

\begin{proposition}\label{LL es suficiente para BnL}
For each $a\in K\setminus\{0,-1\}$ and $L\in\mathcal{L}$, there exists a twisting map with the matrix $\mm$ satisfying
$$
\mm_{j,*}=\begin{cases}
                \mm_{0*}, & \mbox{if } j<L_1 \\
            d^k \mm_{0*}, & \mbox{if } L_k<j<L_{k+1} \\
            d^k E_0- d^{k-1}E_1+a E_{L_k+1}, & \mbox{if $j=L_k$}.
          \end{cases}
$$
\end{proposition}

\begin{proof}
By Lemma~\ref{lema conditions to prove BNL} it suffices to prove that
\begin{enumerate}
  \item $\mm Y^{k}\mm=0$ for $k\in \mathds{N}_0$ with $k,k+1\ne L_t$ for any $t$,
  \item $\mm Y^{L_r}\mm+Y\mm Y^{L_r-1}\mm=a Y^{L_r+1}\mm$ for all $r\in\mathds{N}$,
  \item $\mm Y^{L_r-1}\mm=a\sum_{i=0}^{L_r}Y^i\mm Y^{L_r-i}-ra^2Y^{L_r+1}$ for all $r\in\mathds{N}$.
\end{enumerate}
In order to verify these equalities, we will use that
\begin{equation}\label{MYM entradas}
(\mm Y^k \mm)_{i,j}=\mm_{i,*}\cdot (Y^k\mm)_{*,j}=\begin{cases}
                                                    \mm_{k,j}-\mm_{k+1,j}, & \mbox{if } i<n=L_1 \\
                                                    d^{r}(\mm_{k,j}-\mm_{k+1,j}), & \mbox{if } L_r<i<L_{r+1} \\
                                                    d^r \mm_{k,j}-d^{r-1}\mm_{k+1,j}+a\mm_{k+L_r+1,j}, & \mbox{if } i=L_r.
                                                  \end{cases}
\end{equation}
(1): We will prove $(\mm Y^k \mm)_{i,j}=0$ for the distinct choices of $j$.\\
If $j\notin\{0,1\}$ and $j-1\ne L_t$, then directly $(Y^k\mm)_{*j}=0$.\\
If $j=0$ and $i<n$,  then $(\mm Y^k \mm)_{i,j}= \mm_{k,0}-\mm_{k+1,0}=0$.\\
If $j=1$ and $i<n$,  then $(\mm Y^k \mm)_{i,j}= \mm_{k,1}-\mm_{k+1,1}=0$.\\
If $j=0$ and $L_r<i<L_{r+1}$,  then $(\mm Y^k \mm)_{i,j}= d^r(\mm_{k,0}-\mm_{k+1,0})=0$.\\
If $j=1$ and $L_r<i<L_{r+1}$,  then $(\mm Y^k \mm)_{i,j}= d^r(\mm_{k,1}-\mm_{k+1,1})=0$.\\
If $j=0$ and $i=L_{r}$,  then
$$
(\mm Y^k \mm)_{i,j}= d^r \mm_{k,0}-d^{r-1}\mm_{k+1,0}+a\mm_{k+L_r+1,0},
$$
and so, since $L_s<k<L_s-1$ for some $s$ which implies $\mm_{k,0}=\mm_{k+1,0}=d^s$, and
$$
L_{r+s}<L_r+L_s+2\le k+L_r+1\le L_r+L_s-1<L_{r+s+1},
$$
we obtain
$$
(\mm Y^k \mm)_{i,j}=d^{r+s}-d^{r+s-1}+a d^{r+s}=d^{r+s-1}(d-1+ad)=0,
$$
as desired.
Similarly, if $j=1$ and $i=L_{r}$,  then
$$
(\mm Y^k \mm)_{i,j}= d^r \mm_{k,1}-d^{r-1}\mm_{k+1,1}+a\mm_{k+L_r+1,1},
$$
and so, since $L_s<k<L_s-1$ for some $s$ which implies $\mm_{k,1}=\mm_{k+1,1}=-d^s$, and
$$
L_{r+s}<L_r+L_s+2\le k+L_r+1\le L_r+L_s-1<L_{r+s+1},
$$
we obtain
$$
(\mm Y^k \mm)_{i,j}=-d^{r+s}+d^{r+s-1}-a d^{r+s}=d^{r+s-1}(-d+1-ad)=0,
$$
as desired.

Note that here we use $L\in \mathcal{L}$.

Finally if $j=L_s+1$ for some $s$, then $\mm_{i,j} =a\delta_{i,L_s}$ and so
$$
(\mm Y^k \mm)_{i,j}=\sum_v \mm_{i,v}\mm_{v+k,j}=a\mm_{i,L_s-k}.
$$
But $L_t<k<L_{t+1}-1$ implies
$$
L_{s-t}+1\ge L_s-L_t> L_s-k>L_s-L_{t+1}+1\ge L_{s-t-1}+1,
$$
and so $\mm_{i,L_s-k}=0$, since clearly $L_s-k\notin\{0,1\}$. This concludes the proof of~(1).

\noindent (2): We will prove
\begin{equation}\label{MYM+YMYM}
(\mm Y^{L_r}\mm)_{i,j}+(Y\mm Y^{L_r-1}\mm)_{i,j}=(a Y^{L_r+1}\mm)_{i,j}
\end{equation}
 for the distinct choices of $j$.\\
If $j\notin\{0,1\}$ and $j-1\ne L_t$, then directly $(Y^k\mm)_{*j}=0$ and both sides vanish.\\
A straightforward computation proves the cases $(i,j)\in\{(0,0),(0,1)\}=0$.
Now we verify the case $j=0$, $i>0$. If $L_s<i<L_{s+1}-1$, then
\begin{align*}
  (\mm Y^{L_r}\mm)_{i,0} & =  d^{s}(\mm_{L_r,0}-\mm_{L_r+1,0})=d^s(d^r-d^r)=0 \\
  (Y\mm Y^{L_r-1}\mm)_{i,0} & = (\mm Y^{L_r-1}\mm)_{i+1,0} = d^{s}(\mm_{L_r-1,0}-\mm_{L_r,0})=d^s(d^{r-1}-d^r)=ad^{r+s}.
\end{align*}
But
$$
L_{r+s}\le L_r+L_s+1< L_r+i+1<L_r+L_{s+1}\le L_{r+s+1},
$$
and so $\mm_{L_r+i+1,0}=d^{r+s}$, hence
$$
(a Y^{L_r+1}\mm)_{i,0}=a\mm_{L_r+i+1,0}=ad^{r+s},
$$
which proves~\eqref{MYM+YMYM} in this case.

If $j=0$ and $i=L_s$, then
$$
(\mm Y^{L_r}\mm)_{L_s,0}  =  d^{s} \mm_{L_r,0}-d^{s-1}\mm_{L_r+1,0}+a \mm_{L_r+L_s+1,0}=d^s d^r-d^{r+s-1}+a d^{r+s} =0
$$
where the second equality follows from the fact that $L_{r+s}\le L_r+L_s+1\le L_{r+s}+1$ implies $\mm_{L_r+L_s+1,0}=d^{r+s}$.
We also have in that case
$$
  (Y\mm Y^{L_r-1}\mm)_{L_s,0}  = (\mm Y^{L_r-1}\mm)_{L_s+1,0}= d^{s}(\mm_{L_r-1,0}-\mm_{L_r,0})=d^s(d^{r-1}-d^r)=ad^{r+s},
$$
and
$$
(a Y^{L_r+1}\mm)_{L_s,0}=a\mm_{L_r+L_s+1,0}=ad^{r+s},
$$
which proves~\eqref{MYM+YMYM} in this case.

If $j=0$ and $i=L_s-1$, then
$$
(\mm Y^{L_r}\mm)_{L_s-1,0}  =  d^{s} (\mm_{L_r,0}-\mm_{L_r+1,0})=d^s( d^r-d^{r})=0.
$$
We also have in that case
\begin{eqnarray*}
(Y\mm Y^{L_r-1}\mm)_{L_s-1,0}  &=&(\mm Y^{L_r-1}\mm)_{L_s,0}= d^{s}\mm_{L_r-1,0}-d^{s-1}\mm_{L_r,0}+a \mm_{L_s+L_r,0}\\
&=&d^s d^{r-1}-d^{s-1}d^r+a\mm_{L_s+L_r,0}=a\mm_{L_s+L_r,0},
\end{eqnarray*}
and
$$
(a Y^{L_r+1}\mm)_{L_s-1,0}=a\mm_{L_r+L_s,0}
$$
which proves~\eqref{MYM+YMYM} in this case and completes the proof for the case $j=0$.

Now we verify the case $j=1$, $i>0$. If $L_s<i<L_{s+1}-1$, then
\begin{align*}
  (\mm Y^{L_r}\mm)_{i,1} & =  d^{s}(\mm_{L_r,1}-\mm_{L_r+1,1})=d^s(-d^{r-1}+d^r)=-a d^{r+s} \\
  (Y\mm Y^{L_r-1}\mm)_{i,1} & = (\mm Y^{L_r-1}\mm)_{i+1,1} = d^{s}(\mm_{L_r-1,1}-\mm_{L_r,1})=d^s(-d^{r-1}+d^{r-1})=0.
\end{align*}
But
$$
L_{r+s}\le L_r+L_s+1< L_r+i+1<L_r+L_{s+1}\le L_{r+s+1},
$$
and so $\mm_{L_r+i+1,1}=-d^{r+s}$, hence
$$
(a Y^{L_r+1}\mm)_{i,1}=a\mm_{L_r+i+1,1}=-ad^{r+s},
$$
which proves~\eqref{MYM+YMYM} in this case.

If $j=1$ and $i=L_s$, then
\begin{eqnarray*}
(\mm Y^{L_r}\mm)_{L_s,1}  &=&d^{s} \mm_{L_r,1}-d^{s-1}\mm_{L_r+1,1}+a \mm_{L_r+L_s+1,1}\\
     &=& d^s d^{r-1}-d^{s-1} d{r}+a \mm_{L_r+L_s+1,1} = a \mm_{L_r+L_s+1,1}.
  \end{eqnarray*}
We also have in that case
$$
  (Y\mm Y^{L_r-1}\mm)_{L_s,1}  = (\mm Y^{L_r-1}\mm)_{L_s+1,1}= d^{s}(\mm_{L_r-1,1}-\mm_{L_r,1})=d^s(d^{r-1}-d^{r-1})=0,
$$
and
$$
(a Y^{L_r+1}\mm)_{L_s,1}=a\mm_{L_r+L_s+1,1},
$$
which proves~\eqref{MYM+YMYM} in this case.

If $j=1$ and $i=L_s-1$, then
$$
(\mm Y^{L_r}\mm)_{L_s-1,1}  =  d^{s} (\mm_{L_r,1}-\mm_{L_r+1,1})=d^s( -d^{r-1}+d^{r})=-ad^{r+s-1}.
$$
We also have in that case
\begin{eqnarray*}
(Y\mm Y^{L_r-1}\mm)_{L_s-1,1}  &=&(\mm Y^{L_r-1}\mm)_{L_s,1}= d^{s}\mm_{L_r-1,1}-d^{s-1}\mm_{L_r,1}+a \mm_{L_r+L_s,1}\\
&=&d^s(- d^{r-1})+d^{s-1}d^{r-1}+a\mm_{L_s+L_r,1}=ad^{r+s-1}+a\mm_{L_s+L_r,1},
\end{eqnarray*}
and
$$
(a Y^{L_r+1}\mm)_{L_s-1,1}=a\mm_{L_r+L_s,1}
$$
which proves~\eqref{MYM+YMYM} in this case and so we complete the case $j=1$.

Now we prove the case $j=L_s+1$. In this case $\mm_{i,L_s+1}=\delta_{i,L_s}$ and so
\begin{align*}
  (\mm Y^{L_r}\mm)_{i,L_s+1} & =\sum_{t} \mm_{i,t}\mm_{t+L_r,L_s+1}=a \mm_{i,L_s-L_r},  \\
  (Y\mm Y^{L_r-1}\mm)_{i,L_s+1} & =(\mm Y^{L_r-1}\mm)_{i+1,L_s+1} =\sum_{t} \mm_{i+1,t}\mm_{t+L_r-1,L_s+1}=a \mm_{i+1,L_s-L_r+1},  \\
   a (Y^{L_r+1}\mm)_{i,L_s+1} & = a \mm_{L_r+i+1,L_s+1}=\begin{cases}
                                                          a^2, & \mbox{if } L_r+i+1=L_s \\
                                                          0, & \mbox{otherwise}.
                                                        \end{cases}  \\
\end{align*}

If $s<r$ then the three terms vanish and so~\eqref{MYM+YMYM} holds trivially.
If $s=r$, then for all $i$ we have
$$
(\mm Y^{L_r}\mm)_{i,L_s+1}+ (Y\mm Y^{L_r-1}\mm)_{i,L_s+1} =a \mm_{i,0}+a \mm_{i+1,1}=0.
$$
But $i+1=0$ is impossible, so the third term vanishes, too, which proves~\eqref{MYM+YMYM} in this case.
If $s>r$, then we consider the to possible cases $L_{s-r}=L_s-L_r$ and $L_{s-r}=L_s-L_r-1$.
If $L_{s-r}=L_s-L_r$, then $a \mm_{i,L_s-L_r}=a \mm_{i,L_{s-r}}=0$ for all $i$, and
$$
a \mm_{i+1,L_s-L_r+1}=a \mm_{i+1,L_{s-r}+1}=\begin{cases}
                                              a^2, & \mbox{if } i+1=L_{s-r} \\
                                              0, & \mbox{otherwise}.
                                            \end{cases}
$$
But $L_r+i+1=L_s$ if and only if $i+1=L_s-L_r=L_{s-r}$, so~\eqref{MYM+YMYM} holds.

If $L_{s-r}=L_s-L_r-1$, then
$$
a \mm_{i,L_s-L_r}=a \mm_{i,L_{s-r}+1}=\begin{cases}
                                              a^2, & \mbox{if } i=L_{s-r} \\
                                              0, & \mbox{otherwise},
                                            \end{cases}
$$
and $a \mm_{i+1,L_s-L_r+1}=a \mm_{i,L_{s-r}+2}=0$ for all $i$.
But $L_r+i+1=L_s$ if and only if $i=L_s-L_r-1=L_{s-r}$, so~\eqref{MYM+YMYM} holds, which completes the proof in the case $j=L_s+1$ and thus
concludes the proof of~(2).

Now we prove~(3) at each entry:
$$
(\mm Y^{L_r-1}\mm)_{i,j}=a\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,j}-ra^2(Y^{L_r+1})_{i,j},
$$
for the five cases
\begin{enumerate}
  \item[a)]$j=0$,
  \item[b)]$j=1$,
  \item[c)]$j=L_s+1$  and  $j\ne i+L_r+1$ ,
  \item[d)]$j=i+L_r+1$,
  \item[e)]$j>1$, $j\ne i+L_r+1$ and $j\ne L_s+1$ for all $s$.
\end{enumerate}
We  first prove e). In this case $(\mm Y^{L_r-1}\mm)_{i,j}=0$ because $j>1$ and $j\ne L_s+1$, and $(Y^{L_r+1})_{i,j}=0$ since $j\ne i+L_r+1$. Moreover
$$
\sum_{s=0}^{L_r}(Y^s\mm Y^{L_r-s})_{i,j}=\sum_{s=0}^{L_r}(\mm )_{i+s,j+s-L_r}=\mm_{-j+i+L_r,0}+\mm_{-j+i+1+L_r,1}=0,
$$
since $j\ne i+L_r+1$ and $\mm_{k,0}+\mm_{k+1,1}=0$ if $k+1\ne 0$ (Note that $\mm_{k,i}=0$ if $k<0$).

Now we prove a): $j=0$. In this case we have to prove
\begin{equation}\label{igualdad en primera columna}
(\mm Y^{L_r-1}\mm)_{i,0}=a (Y^{L_r}\mm)_{i,0},
\end{equation}
 since all other matrices have vanishing first column.
If $i<n$, then~\eqref{igualdad en primera columna} reads $\mm_{L_r-1,0}-\mm_{L_r,0}=a\mm_{L_r+i,0}$ which is true, since  $\mm_{L_r-1,0}=d^{r-1}$, $\mm_{L_r,0}=d^{r}$
and $a\mm_{L_r+i,0}=ad^{r}$.

If $L_s<i<L_{s+1}$, then~\eqref{igualdad en primera columna} reads $d^s(\mm_{L_r-1,0}-\mm_{L_r,0})=a\mm_{L_r+i,0}$ which is true, since  $\mm_{L_r-1,0}=d^{r-1}$, $\mm_{L_r,0}=d^{r}$
and $a\mm_{L_r+i,0}=ad^{r+s}$, since
$$
L_{r+s}\le L_r+L_s+1\le \le L_r+i<L_r+L_{s+1}\le L_{r+s+1}.
$$

If $i=L_s$, then~\eqref{igualdad en primera columna} reads $d^s \mm_{L_r-1,0}-d^{s-1}\mm_{L_r,0}+a\mm_{L_r+L_s,0}=a\mm_{L_r+L_s,0}$ which is true, since  $\mm_{L_r-1,0}=d^{r-1}$, $\mm_{L_r,0}=d^{r}$.
This proves a).

Now we prove b): $j=1$. In this case we have to prove
\begin{equation}\label{igualdad en segunda columna}
(\mm Y^{L_r-1}\mm)_{i,1}=a (Y^{L_r}\mm)_{i,1}+a (Y^{L_r-1}\mm Y)_{i,1},
\end{equation}
 since all other matrices have vanishing first two columns.
 But
 $$
 a (Y^{L_r}\mm)_{i,1}+a (Y^{L_r-1}\mm Y)_{i,1}=a(\mm_{L_r+i,1}+\mm_{L_r+i-1,0})=0,
 $$
and so we have to prove that $(\mm Y^{L_r-1}\mm)_{i,1}=0$. For $L_s<i<L_{s+1}$ we have
$$
(\mm Y^{L_r-1}\mm)_{i,1}=d^s(\mm_{L_r-1,1}-\mm_{L_r,1})=0,
$$
and for $i=L_s$ we have
$$
(\mm Y^{L_r-1}\mm)_{i,1}=d^s \mm_{L_r-1,1}-d^{s-1}\mm_{L_r,1}+a \mm_{L_s+L_r,1}=d^s d^{r-1}-d^{s-1}d^{r-1}+a d^{r+s-1}=0,
$$
since $L_{r+s-1}<L_r+L_s\le L_{r+s}$ implies $\mm_{L_s+L_r,1}=d^{r+s-1}$. This proves the case b), $j=1$.

Now we prove c): $j=L_t+1$ and $j\ne L_r+1+i$. In this case $(Y^{L_r+1})_{i,j}=0$ and $\mm_{i,L_t+1}=\delta_{i,L_t}$, hence
$$
(\mm Y^{L_r-1}\mm)_{i,j}=\sum_u \mm_{i,u}\mm_{u+L_r-1,j}=a \mm_{i,L_t-L_r+1}.
$$
We also have $(Y^u \mm Y^{L_r-u})_{i,L_t+1}=\mm{u+i,L_t+1+u-L_r}$.

If $t<r$, then $\mm_{i,L_t-L_r+1}=0$, and $\mm{u+i,L_t+1+u-L_r}\ne 0$ only if $L_t+1+u-L_r\in\{0,1\}$, because $u+i+1=L_t+1+u-L_r$ leads to $j=L_t+1=i+1+L_r$ which we have excluded.
So
$$
\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,j}=\sum_{u=0}^{L_r}\mm_{i+u,L_s+1+u-L_r}=\mm_{i+L_r-L_s-1,0}+\mm_{i+L_r-L_s,1}=0,
$$
since $i+L_r-L_s\ne 0$ as it would lead to $j=L_s+1=L_r+1+i$. This proves the case c) when $t<r$.

If $t=r$, then $(\mm Y^{L_r-1}\mm)_{i,L_t+1}=a\mm_{i,1}$. Moreover  $(Y^u \mm Y^{L_r-u})_{i,L_t+1}=\mm{u+i,L_t+1+u-L_r}=\mm{u+i,1+u}$ which is different from 0 only
if $1+u=1$, i.e., for $u=0$. But then
$$
a\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,L_t+1}=a\mm_{i,1},
$$
as desired. This proves the case c) for $t=r$. If $t>r$, then $(\mm Y^{L_r-1}\mm)_{i,j}=a\mm_{i,L_t-L_r+1}=0$, since $i\ne L_t-L_r$. But we also have $ \mm_{i+u,u+L_t-L_r+1}=0$,
since $i\ne L_t-L_r$, so the case c) is settled.

Finally we prove d): $j=i+L_r+1$. In this case $(Y^{L_r+1})_{i,j}=1$. If $i=0$, then we have
$$
(\mm Y^{L_r-1}\mm)_{0,L_r+1}=-a,
$$
$$
\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{0,L_r+1}=\sum_{u=0}^{L_r}\mm_{u,u+1}=-1+ra,
$$
since $\mm_{u,u+1}=a$ for $u=L_t$. But
$$
-ra^2(Y^{L_r+1})_{0,L_r+1}=-ra^2,
$$
so~(3) holds at the entry $(0,L_r+1)$.
Now, if $i>0$, then
$$
(\mm Y^{L_r-1}\mm)_{i,i+L_r+1}=\begin{cases}
                                 \mm_{L_r-1,L_r+1+i}-\mm_{L_r,L_r+1+i}=0, & \mbox{if } 0<i<n=L_1 \\
                                 d^t(\mm_{L_r-1,L_r+1+i}-\mm_{L_r,L_r+1+i})=0, & \mbox{if } L_t<i<L_{t+1} \\
                                 d^t \mm_{L_r-1,L_r+1+i}-d^{t-1}\mm_{L_r,L_r+1+i}+a\mm_{L_r+L_t,L_r+1+i}, & \mbox{if } i=L_t. \\
                               \end{cases}
$$
So $(\mm Y^{L_r-1}\mm)_{i,i+L_r+1}=a\mm_{L_r+L_t,L_r+L_t+1}$ if $i=L_t$. But $\mm_{L_r+L_t,L_r+L_t+1}=a$ if $L_{t+r}=L_t+L_r$ and zero otherwise.

On the other hand, for $L_t<i<L_{t+1}$ we have
$$
\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,i+L_r+1}=\sum_{u=0}^{L_r}\mm_{i+u,i+u+1}=\sum_{s=1}^{r}\mm_{L_{t+s},L_{t+s}+1}=ra,
$$
since $i>0$ and $L_{r+t+1}\ge L_{t+1}+L_r>L_r+i\ge L_r+L_t+1\ge L_{r+t}$.
Consequently~(3) holds at the entry $(i,i+L_r+1)$.

Finally, if $i=L_t$, we have two possibilities: Either $L_{t+r}=L_t+L_r$ or $L_{t+r}=L_t+L_r+1$.  If $L_{t+r}=L_t+L_r$, then
$$
\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,i+L_r+1}=\sum_{u=0}^{L_r}\mm_{i+u,i+u+1}=\sum_{s=0}^{r}\mm_{L_{t+s},L_{t+s}+1}=(r+1)a,
$$
which together with $(\mm Y^{L_r-1}\mm)_{L_t,L_t+L_r+1}=a\mm_{L_r+L_t,L_r+L_t+1}=a^2$ proves
$$
(\mm Y^{L_r-1}\mm)_{L_t,L_t+L_r+1}=a\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{L_t,L_t+L_r+1}-ra^2(Y^{L_r+1})_{L_t,L_t+L_r+1}.
$$

If $L_{t+r}=L_t+L_r+1$, then
$$
\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{i,i+L_r+1}=\sum_{u=0}^{L_r}\mm_{i+u,i+u+1}=\sum_{s=0}^{r-1}\mm_{L_{t+s},L_{t+s}+1}=ra,
$$
which together with $(\mm Y^{L_r-1}\mm)_{L_t,L_t+L_r+1}=0$ proves
$$
(\mm Y^{L_r-1}\mm)_{L_t,L_t+L_r+1}=a\sum_{u=0}^{L_r}(Y^u\mm Y^{L_r-u})_{L_t,L_t+L_r+1}-ra^2(Y^{L_r+1})_{L_t,L_t+L_r+1}.
$$
This completes the proof of d).
\end{proof}

\end{document}

redpajama_set_name: RedPajamaArXiv