<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}
\usepackage{mathdots}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}
\newcommand{\G}{\mbox{$\mathcal{G}$}}

\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
\vskip 1cm{\Large\bf Algebraic Generating Functions for Languages \\
\vskip .05in
Avoiding Riordan Patterns}
\vskip 1cm
Donatella Merlini and Massimo Nocentini\\
Dipartimento di Statistica, Informatica, Applicazioni\\
Universit\`a di Firenze\\
viale Morgagni 65 \\
50134 Firenze \\
Italia
 \\
\href{mailto:donatella.merlini@unifi.it}{\tt donatella.merlini@unifi.it}\\
\href{mailto:massimo.nocentini@unifi.it}{\tt massimo.nocentini@unifi.it}\\
\ \\
\end{center}


\vskip .2 in
\begin{abstract}
We study the languages  $\mathfrak{L}^{[\mathfrak{p}]}\subset \{0,1\}^*$ of
binary words $w$ avoiding a given pattern $\mathfrak{p}$ such that $|w|_0\leq
|w|_1$ for every $w\in \mathfrak{L}^{[\mathfrak{p}]},$ where  $|w|_0$ and $|w|_1$
correspond to the number of $0$-bits  and $1$-bits in the word $w$, respectively.  In
particular, we concentrate on  patterns $\mathfrak{p}$ related to the concept
of Riordan arrays. These languages are not regular,
but can be enumerated by
algebraic generating functions corresponding to many integer sequences that
were previously unlisted in the On-Line Encyclopedia of Integer Sequences.
We give explicit formulas for these generating
functions, expressed in terms of the autocorrelation polynomial of
$\mathfrak{p}$, and also give explicit formulas for the coefficients of some
particular patterns, algebraically and combinatorially.

\end{abstract}

\section{Introduction}
\label{sec:introduction}


In this paper we study the languages  $\mathfrak{L}^{[\mathfrak{p}]}\subset
\{0,1\}^*$ of binary words avoiding a given binary pattern $\mathfrak{p}$,
having the property that $|w|_0\leq |w|_1$ for every word $w\in
\mathfrak{L}^{[\mathfrak{p}]},$ where  $|w|_0$ and $|w|_1$ correspond to the
number of $0$-bits  and $1$-bits in the word $w$, respectively.  The notion of a
pattern can be formalized in several ways. In this paper we consider
\textit{factor patterns}, that is, patterns whose  letters must appear in 
exact order and contiguously in the sequence under observation.  The set of
binary words avoiding a pattern, without the restriction $|w|_0\leq |w|_1$, is
defined by a regular language,
and can be enumerated in terms of the number of
$1$-bits  and $0$-bits  by using classical results  (see, e.g., Guibas and Odlyzko
\cite{GO80,GO81} and Sedgewick and Flajolet \cite{SF96}).  However, when we consider the additional restriction
that the words have no more $0$-bits  than $1$-bits, the language is no longer
regular and enumerating it is a harder problem.

In this paper we are interested in \textit{Riordan patterns}, a concept 
defined by Sprugnoli and the first author \cite{MS11} in terms of the \textit{autocorrelation
polynomial} $C^{[\mathfrak{p}]}(x,y)$ of pattern $\mathfrak{p}=p_{0}\cdots
p_{h-1}$. The coefficients of this polynomial are given by the
\textit{autocorrelation vector} associated to $\mathfrak{p}$, that is, the
vector $c=(c_0,\ldots ,c_{h-1})$ of bits defined in terms of Iverson's bracket
notation (for a predicate $P$, the expression $[\![P]\!]$ has value $1$ if $P$
is true and $0$ otherwise) as follows:
$$c_i=[\![p_0p_1\cdots p_{h-1-i}=p_{i}p_{i+1}\cdots p_{h-1}]\!];$$
or in words, the bit $c_i$ is determined by shifting $\mathfrak{p}$ to the right by
$i$ positions, setting $c_i=1$ if and only if the remaining letters match the
original. For example, when $\mathfrak{p}= 10101$ the autocorrelation vector is
$c=(1,0,1,0,1)$, as illustrated in Table \ref{auto}, and
$C^{[\mathfrak{p}]}(x,y)=1+xy+x^2y^2$, namely we add a term $x^jy^i$ for each
tail of the pattern with $j$ $1$-bits  and $i$ $0$-bits, where $c_{j+i}=1$.
\begin{table}[H]
    \begin{center}
        \begin{tabular}{ccccc|ccccccc}
          $1$ &amp; $0$ &amp; $1$ &amp; $0$&amp; $1$ &amp;   \multicolumn{6}{l}{Tails} &amp; $c_{i}$  \\
          \hline
          $1$ &amp; $0$ &amp; $1$ &amp; $0$ &amp; $1$ &amp; &amp;   &amp;   &amp;   &amp;   &amp;   &amp;    $1$ \\
            &amp; $1$ &amp; $0$ &amp; $1$ &amp; $0$ &amp; $1$ &amp;  &amp;   &amp;   &amp;   &amp;   &amp;    $0$ \\
            &amp;   &amp; $1$ &amp; $0$ &amp; $1$ &amp; $0$ &amp; $1$ &amp;  &amp;   &amp;   &amp;   &amp;    $1$ \\
            &amp;   &amp;   &amp; $1$ &amp; $0$ &amp; $1$ &amp; $0$ &amp; $1$ &amp;  &amp;   &amp;   &amp;    $0$ \\
            &amp;   &amp;   &amp;   &amp; $1$ &amp; $0$ &amp; $1$ &amp; $0$ &amp; $1$ &amp;  &amp;   &amp;    $1$ \\
        \end{tabular}
    \end{center}
\caption{\label{auto}The autocorrelation vector for  $\mathfrak{p}= 10101$.}
\end{table}
For each pattern $\mathfrak{p},$  we can compute the \textit{complement} pattern
$\mathfrak{\bar{p}}$  by changing every $1$ to $0$ and every $0$ to $1$; for
example, if $\mathfrak{p}= 10101$ then $\mathfrak{\bar{p}}=01010$, therefore
$C^{[\mathfrak{p}]}(x,y)=C^{[\mathfrak{\bar{p}}]}(y,x)$.

Addition of constraints to the nature of a pattern $\mathfrak{p}$ yields
the following definition:
\begin{definition}[Riordan pattern]
\label{defrp}
We say that $\mathfrak{p}=p_0\cdots p_{h-1}$ is a Riordan pattern if and only
if
\begin{displaymath}
C^{[\mathfrak{p}]}(x,y)=C^{[\mathfrak{\bar{p}}]}(y,x)=\sum_{i=0}^{\lfloor(h-1)/2\rfloor}c_{2i}x^iy^i,
\quad \mbox{with} \quad |n_1^{[\mathfrak{p}]}-n_0^{[\mathfrak{p}]}|\in
\left\{0,1 \right\}
\end{displaymath}
where $n_1^{[\mathfrak{p}]}$ and  $n_0^{[\mathfrak{p}]}$ correspond to the
number of $1$-bits  and $0$-bits  in the pattern, respectively.
\end{definition}

For example, Table \ref{auto} corresponds to a Riordan pattern and $\mathfrak{p}= 1100110110011000$ is another Riordan pattern having
$n_1^{[\mathfrak{p}]}=n_0^{[\mathfrak{p}]}=8$ and
$C^{[\mathfrak{p}]}(x,y)=1$. Moreover, in Table \ref{tutti7} we give all the Riordan  patterns of length 7 with first bit equal to $1$ and their correlation polynomials,
the corresponding complement patterns can be easily determined.

\begin{table}[H]
$$
{\displaystyle
\begin{array}{|c|c|}
  \hline
  \mathfrak{p} &amp; C^{[\mathfrak{p}]}(x,y)\\
  \hline
{\displaystyle {1010100, 1011000 \atop 1011100, 1100010}} &amp; \\  [0.3cm]
{\displaystyle {1100100, 1101000 \atop 1101010, 1101100}} &amp;  1\\  [0.3cm]
{\displaystyle {1110000, 1110010 \atop 1110100, 1111000}} &amp; \\  [0.3cm] \hline
1001100, 1100110 &amp;  1+x^2y^2 \\ \hline
{\displaystyle {1000111, 1001011 \atop 1001101, 1010011 }} &amp; 1+x^3y^3 \\  [0.3cm]
{\displaystyle {1011001, 1100101 \atop 1101001, 1110001}} &amp;  \\  [0.3cm] \hline
1010101 &amp;  1+xy+x^2y^2+x^3y^3 \\ \hline
\end{array}
}
$$
\caption{\label{tutti7}The Riordan patterns of length 7 with first bit equal to $1$ and their correlation polynomials}
\end{table}



The name \textit{Riordan} in the above definition is due to the connection with
the well-known concept of \textit{Riordan arrays}.  We briefly recall that a
Riordan array is an infinite lower triangular array  $(d_{n,k} )_{n,k \in
\mathbb{N}},$ defined by a pair of formal power series $(d(t),h(t)),$ such that
$d(0)\neq 0, h(0)=0, h^\prime(0)\neq0$ and the generic element $d_{n,k}$ is the
coefficient of monomial $t^{n}$ in the series expansion of $d(t)h(t)^{k}$. 
Formally,
\begin{displaymath}
    d_{n,k}=[t^n]d(t)h(t)^k, \qquad n,k \geq 0
\end{displaymath}
where $d_{n,k}=0$ for $k&gt;n$. These arrays were introduced in 1991 by Shapiro,
Getu, Woan and Woodson \cite{SGWW91}, with the aim of defining a class of
infinite lower triangular arrays with properties analogous to those of the
Pascal triangle.  Since then they have attracted, and continue to attract,
much attention in the literature.
Some of their structural properties were studied by Rogers, Sprugnoli, Verri and the first author \cite{MRSV97}, and
additional properties were recently analyzed by Luz\'on, Mor\'on, Sprugnoli and the first author \cite{LMMS14}. In particular, we recall
that the bivariate generating function enumerating the sequence
$(d_{n,k} )_{n,k \in\mathbb{N}}$ is
\begin{equation}
    \label{bgf}
    R(t,w) = \sum_{n,k \in\mathbb{N}}{d_{n,k} t^n w^k} = {d(t) \over 1-wh(t)}
\end{equation}

An important property of Riordan array concerns the computation of
combinatorial sums. A first paper in this direction is due to Sprugnoli \cite{Spr94}, while
the case dealing with implicit Riordan arrays is treated by Sprugnoli, Verri and the first author \cite{MSV09}.
In particular we have the following result:
\begin{equation}
    \label{somme}
    \sum_{k=0}^n d_{n,k}f_k=[t^n]d(t)f(h(t)) \quad \mbox{or} \quad \left( d(t), h(t)\right) \ast f(t)= d(t) f(h(t)),
\end{equation}
that is, every combinatorial sum involving a Riordan array can be computed by
extracting the coefficient of $t^n$ from the series expansion of $d(t)f(h(t))$,
where $f(t)=\G(f_k)=\sum_{k\geq 0}f_kt^k$ is the generating function of the
sequence $(f_k)_{k \in\mathbb{N}}$ and the symbol $\G$ denotes the generating function
operator. Due to its importance, relation (\ref{somme}) is often called the
\textit{fundamental rule} of Riordan arrays.  In this paper, the notation
$(f_k)_{k}$ will be used as an abbreviation of $(f_k)_{k\in\mathbb{N}}$.

Coming back to the languages $\mathfrak{L}^{[\mathfrak{p}]}\subset \{0,1\}^*$
of binary words avoiding a pattern $\mathfrak{p}$, let
$R_{n,k}^{[\mathfrak{p}]}$ be the number of words avoiding $\mathfrak{p}$ and
having $n$ $1$-bits  and $n-k$  $0$-bits; additionally, let
$\mathcal{R}^{[\mathfrak{p}]}=\left(R_{n,k}^{[\mathfrak{p}]}\right)_{n,k\in\mathbb{N}}$
the enclosing matrix. The following theorem, which was proved by Sprugnoli and the first author \cite{MS11},
shows the importance of Riordan patterns:
\begin{theorem}
\label{main}
Matrices ${\cal{R}^{[\mathfrak{p}]}}$ and ${\cal{R}^{[\bar{\mathfrak{p}]}}}$
are Riordan arrays if and only if  $\mathfrak{p}$ is a Riordan pattern.
\end{theorem}

By the previous theorem, matrices ${\cal{R}^{[\mathfrak{p}]}}$ and
${\cal{R}^{[\bar{\mathfrak{p}]}}}$ can be defined as
$${\cal{R}^{[\mathfrak{p}]}}=(d^{[\mathfrak{p}]}(t),h^{[\mathfrak{p}]}(t)) \text{ and }
{\cal{R}^{[\bar{\mathfrak{p}]}}}=(d^{[\bar{\mathfrak{p}}]}(t),h^{[\bar{\mathfrak{p}}]}(t))$$
for the appropriate $d^{[\mathfrak{p}]},$ $h^{[\mathfrak{p}]},$ $d^{[\bar{\mathfrak{p}}]},$
$h^{[\bar{\mathfrak{p}}]},$ given a Riordan pattern $\mathfrak{p}$; moreover, they represent the lower and
upper part of the array
${\cal{F}^{[\mathfrak{p}]}}=(F_{n,k}^{[\mathfrak{p}]})_{n,k \in \mathbb{N}}$,
where $F_{n,k}^{[\mathfrak{p}]}$ denotes the number of words avoiding pattern
$\mathfrak{p}$ and having $n$ $1$-bits  and $k$ $0$-bits . For the sake of
clarity, Tables \ref{Fprimo}, \ref{Rprimoa} and \ref{Rprimob} illustrate some
rows for the matrices ${\cal{F}^{[\mathfrak{p}]}},$
${\cal{R}^{[\mathfrak{p}]}}$ and ${\cal{R}^{[\bar{\mathfrak{p}]}}}$, where
$\mathfrak{p}=10101$.

\begin{remark}
 Riordan patterns are not the only patterns
related to Riordan arrays; for example, given the pattern $\mathfrak{p}=0100100$
corresponding to $C^{[\mathfrak{p}]}(x,y)=1+xy^2+x^2y^4$, matrix
${\cal{R}^{[\mathfrak{p}]}}$ is still a Riordan array but ${\cal{R}^{[\bar{\mathfrak{p}}]}}$
is not, as illustrated by Baccherini, Sprugnoli and the first author \cite[Example 5.4]{BMS07a}. However, in these situations it is not
easy to find functions $d^{[\mathfrak{p}]}(t)$ and $h^{[\mathfrak{p}]}(t)$, while for
Riordan patterns it is always possible, as shown in Theorems \ref{main} and \ref{teo1}.
\end{remark}

\begin{table}[H]
$$
\begin{array}{c|cccccccc}
n/k  &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp;5 &amp;6 &amp;7  \\ \cline{1-9}
0 &amp; 1 &amp; 1 &amp; 1 &amp; 1&amp; 1 &amp;  1 &amp; 1 &amp; 1\\
1 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 \\
2 &amp; 1 &amp; 3 &amp; 6 &amp; 10 &amp; 15 &amp; 21 &amp; 28 &amp; 36\\
3 &amp; 1 &amp; 4 &amp; 9 &amp; 18 &amp; 32 &amp; 52&amp; 79 &amp; 114\\
4 &amp; 1&amp; 5 &amp; 13 &amp; 30 &amp; 60 &amp; 109&amp; 184 &amp; 293\\
5 &amp; 1 &amp; 6 &amp; 18 &amp; 46 &amp; 102 &amp; 204 &amp; 377 &amp; 654\\
6 &amp; 1 &amp; 7 &amp; 24 &amp; 67 &amp; 163 &amp; 354&amp; 708 &amp; 1324\\
7 &amp; 1 &amp; 8 &amp; 31 &amp; 94 &amp; 248 &amp;580&amp; 1245 &amp;2490\\
\end{array}
$$
\caption{\label{Fprimo}The  matrix  ${\cal{F}^{[\mathfrak{p}]}}$ for $\mathfrak{p}=10101$}
\end{table}

\begin{table}[H]
\hspace{-.5cm}
\parbox{.47\textwidth}{
\centering
$$
\begin{array}{c|cccccccc}
n/k  &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp;5 &amp;6 &amp;7  \\ \cline{1-9}
0 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp;\\
1 &amp; 2 &amp; 1 &amp; &amp; &amp;  &amp; &amp; &amp;\\
2 &amp; 6&amp; 3 &amp; 1 &amp; &amp; &amp; &amp;  &amp;\\
3 &amp; 18 &amp; 9 &amp; 4 &amp; 1 &amp; &amp; &amp;  &amp;\\
4 &amp; 60 &amp; 30 &amp; 13 &amp; 5 &amp; 1&amp; &amp; &amp; \\
5 &amp; 204 &amp; 102 &amp; 46 &amp; 18 &amp; 6 &amp;1 &amp; &amp;\\
6 &amp; 708 &amp; 354 &amp; 163 &amp; 67 &amp; 24 &amp; 7&amp; 1 &amp;\\
7 &amp; 2490 &amp; 1245 &amp;  580 &amp;248 &amp; 94 &amp; 31 &amp;  8 &amp;1\\
\end{array}
$$
\caption{\label{Rprimoa} ${\cal{R}^{[\mathfrak{p}]}}$ for $\mathfrak{p}=10101$}
}
\hfill
\parbox{.47\textwidth}{
\centering
$$
\begin{array}{c|cccccccc}
n/k  &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp;5 &amp;6 &amp;7  \\ \cline{1-9}
0 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp;\\
1 &amp; 2 &amp; 1 &amp; &amp; &amp;  &amp; &amp; &amp;\\
2 &amp; 6&amp; 3 &amp; 1 &amp; &amp; &amp; &amp;  &amp;\\
3 &amp; 18 &amp; 10 &amp; 4 &amp; 1 &amp; &amp; &amp;  &amp;\\
4 &amp; 60 &amp; 32 &amp; 15 &amp; 5 &amp; 1&amp; &amp; &amp; \\
5 &amp; 204 &amp; 109 &amp; 52 &amp; 21 &amp; 6 &amp;1 &amp; &amp;\\
6 &amp; 708 &amp; 377 &amp; 184 &amp; 79 &amp; 28 &amp; 7&amp; 1 &amp;\\
7 &amp; 2490 &amp; 1324 &amp;  654 &amp;293 &amp; 114 &amp; 36 &amp;  8 &amp;1\\
\end{array}
$$
\caption{\label{Rprimob} ${\cal{R}^{[\bar{\mathfrak{p}]}}}$ for $\mathfrak{p}=10101$}
}
\end{table}

As already observed, the enumeration of the set of binary words avoiding a
pattern, without the restriction about the number of $1$-bits  and $0$-bits can be
done by using classical results and gives
the following rational bivariate generating function for the sequence
$(F_{n,k}^{[\mathfrak{p}]})_{n,k \in \mathbb{N}}:$ $$F^{[\mathfrak{p}]}(x,y)
=\genfrac{}{}{1pt}{0}{C^{[\mathfrak{p}]}(x,y)}{(1-x-y)C^{[\mathfrak{p}]}(x,y)
+x^{n_1^{[\mathfrak{p}]}}y^{n_0^{[\mathfrak{p}]}}},$$ where
$n_1^{[\mathfrak{p}]}$ and  $n_0^{[\mathfrak{p}]}$ correspond to the number of
$1$-bits  and $0$-bits, respectively, and $C^{[\mathfrak{p}]}(x,y)$ is the
autocorrelation polynomial, all relative to pattern $\mathfrak{p}$.
Consequently, $F^{[\mathfrak{p}]}(t,1)$ and $F^{[\mathfrak{p}]}(t,t)$ count the
words avoiding $\mathfrak{p}$ according to the number of $1$-bits  and to length
of each word, respectively.

Using the theory of Riordan arrays and the results by Sprugnoli and the first author \cite{MS11}, we give
explicit algebraic generating functions enumerating the set of binary words
avoiding a Riordan pattern with the restriction $|w|_0\leq |w|_1$ according to
various parameters, in particular to the number of $1$-bits  and to the words length.
Most of the corresponding sequences are new to the On-Line Encyclopedia of
Integer Sequences (OEIS)\footnote{We attach a label $Axxxxxx$ to a
sequence if it appears in the OEIS with that identifier.} \cite{OEIS};
moreover, we also give explicit formulas for the coefficients of some
particular patterns by providing algebraic and combinatorial proofs.

Finally, our results can be interpreted in the theory of paths and codes in
light of the bijection among binary words and paths, which maps a $0$-bit to a
south-east step $\diagdown$ and a $1$-bit  to a north-east step $\diagup$. From
this point of view, a coefficient $R_{n,k}^{[\mathfrak{p}]} \in
\mathcal{R}^{[\mathfrak{p}]}$ counts the number of paths containing $n$ steps
of $\diagup$ and $n-k$ steps of $\diagdown$, avoiding the subpath
corresponding to pattern $\mathfrak{p}$, allowed to cross the $x$-axis but
required to end at coordinate $(2n-k, k)$ such that $0 \leq k \leq n$.
In particular, $d^{[\mathfrak{p}]}(t)$ is the generating function of paths that avoid
 $\mathfrak{p}$ and end on the $x$-axis.


\section{Riordan arrays for Riordan patterns}

We start with a theorem that is a direct consequence of the results by Sprugnoli and the first author
 \cite[Theorems 2.3 and 3.3]{MS11}.
\begin{theorem}
\label{teo1}
Let  $R_{n,k}^{[\mathfrak{p}]}$ be the number of binary words with $n$ $1$-bits
and $n-k$  $0$-bits, avoiding a Riordan pattern $\mathfrak{p}$.  Then the
triangle ${\cal{R}^{[\mathfrak{p}]}}=(R_{n, k}^{[\mathfrak{p}]})$ is a Riordan
array
${\cal{R}^{[\mathfrak{p}]}}=(d^{[\mathfrak{p}]}(t),h^{[\mathfrak{p}]}(t))$. In
particular, if  $n_1^{[\mathfrak{p}]}$ and  $n_0^{[\mathfrak{p}]}$ correspond
to the number of $1$-bits  and  $0$-bits in the pattern, $C^{[\mathfrak{p}]}(x,y)$ is
the autocorrelation polynomial of $\mathfrak{p}$ and
$C^{[\mathfrak{p}]}(t)=C^{[\mathfrak{p}]}(\sqrt{t},\sqrt{t}),$ then
\begin{itemize}

\item if $n_1^{[\mathfrak{p}]}-n_0^{[\mathfrak{p}]}=1$ we have
$$d^{[\mathfrak{p}]}(t)={C^{[\mathfrak{p}]}(t)
\over \sqrt{C^{[\mathfrak{p}]}(t)^2-4tC^{[\mathfrak{p}]}(t)(C^{[\mathfrak{p}]}(t)-t^{n_0^{[\mathfrak{p}]}})}}, $$
$$h^{[\mathfrak{p}]}(t)={C^{[\mathfrak{p}]}(t) -\sqrt{C^{[\mathfrak{p}]}(t)^2-4tC^{[\mathfrak{p}]}(t)(C^{[\mathfrak{p}]}(t)-t^{n_0^{[\mathfrak{p}]}})}
\over 2 C^{[\mathfrak{p}]}(t)};$$

\item if $n_1^{[\mathfrak{p}]}-n_0^{[\mathfrak{p}]}=0$ we have
$$d^{[\mathfrak{p}]}(t)={C^{[\mathfrak{p}]}(t)
\over \sqrt{( C^{[\mathfrak{p}]}(t)+t^{n_0^{[\mathfrak{p}]}})^2-4tC^{[\mathfrak{p}]}(t)^2}},$$
$$h^{[\mathfrak{p}]}(t)=
{C^{[\mathfrak{p}]}(t)+ t^{n_0^{[\mathfrak{p}]}} - \sqrt{( C^{[\mathfrak{p}]}(t)+t^{n_0^{[\mathfrak{p}]}})^2-4tC^{[\mathfrak{p}]}(t)^2}
\over 2 C^{[\mathfrak{p}]}(t)};$$

\item if $n_0^{[\mathfrak{p}]}-n_1^{[\mathfrak{p}]}=1$ we have
$$d^{[\mathfrak{p}]}(t)={C^{[\mathfrak{p}]}(t)
\over \sqrt{C^{[\mathfrak{p}]}(t)^2-4tC^{[\mathfrak{p}]}(t)(C^{[\mathfrak{p}]}(t)-t^{n_1^{[\mathfrak{p}]}})}},$$
$$h^{[\mathfrak{p}]}(t)={C^{[\mathfrak{p}]}(t) -\sqrt{C^{[\mathfrak{p}]}(t)^2-4tC^{[\mathfrak{p}]}(t)(C^{[\mathfrak{p}]}(t)-t^{n_1^{[\mathfrak{p}]}})}
\over 2 (C^{[\mathfrak{p}]}(t)- t^{n_1^{[\mathfrak{p}]}})}.$$

\end{itemize}
\end{theorem}

If $R^{[\mathfrak{p}]}(t,w)$ denotes the bivariate generating function of the
Riordan array ${\cal{R}^{[\mathfrak{p}]}},$ as already mentioned in the
Introduction, we have
$$R^{[\mathfrak{p}]}(t,w)=\sum_{n,k\in\mathbb{N}} R_{n, k}^{[\mathfrak{p}]}t^n
w^k={d^{[\mathfrak{p}]}(t) \over 1-wh^{[\mathfrak{p}]}(t)},$$ and Theorem
\ref{teo1} allow us to state the following results.

\begin{theorem}
\label{teo2}
Let $\mathfrak{p}$ be  a Riordan pattern and $S^{[\mathfrak{p}]}(t)=\sum_{n\geq
0}S_n^{[\mathfrak{p}]}t^n$ the generating function enumerating the set of binary words $\left\lbrace w\in
\lbrace 0,1 \rbrace^{*}: |w|_0\leq |w|_1\right\rbrace$ avoiding  a Riordan
pattern $\mathfrak{p}$ according to the number of $1$-bits. Then we have

\begin{itemize}

\item if $n_1^{[\mathfrak{p}]}=n_0^{[\mathfrak{p}]}+1$
$$S^{[\mathfrak{p}]}(t)={2C^{[\mathfrak{p}]}(t) \over \sqrt{Q(t)}\left(\sqrt{C^{[\mathfrak{p}]}(t)}+ \sqrt{Q(t)} \right)}, $$
    where $Q(t)={(1-4t)C^{[\mathfrak{p}]}(t)^2+4t^{n_1^{[\mathfrak{p}]}}};$

\item if $n_0^{[\mathfrak{p}]}=n_1^{[\mathfrak{p}]}+1$
$$S^{[\mathfrak{p}]}(t)={2C^{[\mathfrak{p}]}(t)(C^{[\mathfrak{p}]}(t)-t^{n_1^{[\mathfrak{p}]}}
) \over \sqrt{Q(t)} \left(C^{[\mathfrak{p}]}(t)-2t^{n_1^{[\mathfrak{p}]}}+ \sqrt{Q(t)} \right) },$$
    where $Q(t)={ (1-4t)C^{[\mathfrak{p}]}(t)^2+4t^{n_0^{[\mathfrak{p}]}}C^{[\mathfrak{p}]}(t)};$

\item if $n_1^{[\mathfrak{p}]}=n_0^{[\mathfrak{p}]}$
$$S^{[\mathfrak{p}]}(t)={2C^{[\mathfrak{p}]}(t)^2 \over \sqrt{Q(t)}
    \left(C^{[\mathfrak{p}]}(t)-t^{n_0^{[\mathfrak{p}]}}+ \sqrt{Q(t)} \right) },$$
where $Q(t)=(1-4t)C^{[\mathfrak{p}]}(t)^2+2t^{n_0^{[\mathfrak{p}]}}C^{[\mathfrak{p}]}(t)+t^{2n_0^{[\mathfrak{p}]}}$.

\end{itemize}
\end{theorem}
\begin{proof}
For the proof we can observe that $S^{[\mathfrak{p}]}(t)=\sum_{n\geq
0}S_n^{[\mathfrak{p}]}t^n=R^{[\mathfrak{p}]}(t,1),$ or, equivalently, that
$S_n^{[\mathfrak{p}]}=\sum_{k=0}^nR_{n, k}^{[\mathfrak{p}]}$ and apply the
fundamental rule (\ref{somme}) with $f_k=1$. The statement of the theorem can
be found after some algebraic simplification.
\end{proof}

\begin{theorem}
\label{teo3}
Let $\mathfrak{p}$ be  a Riordan pattern and $L^{[\mathfrak{p}]}(t)=\sum_{n\geq
0}L_n^{[\mathfrak{p}]}t^n$ the generating function enumerating the set of binary words $\left\lbrace w\in
\lbrace 0,1 \rbrace^{*}: |w|_0\leq |w|_1\right\rbrace$ avoiding  a Riordan
pattern $\mathfrak{p}$ according to the length. Then we
have
\begin{itemize}

\item if $n_1^{[\mathfrak{p}]}=n_0^{[\mathfrak{p}]}+1$
$$L^{[\mathfrak{p}]}(t)= {2tC^{[\mathfrak{p}]}(t^2)^2 \over \sqrt{Q(t)}\left((2t-1)C(t^2)+ \sqrt{ Q(t) } \right)}, $$
where $Q(t)=C^{[\mathfrak{p}]}(t^2)\left( (1-4t^2)C^{[\mathfrak{p}]}(t^2)+4t^{2n_1^{[\mathfrak{p}]}}\right);$

\item if $n_0^{[\mathfrak{p}]}=n_1^{[\mathfrak{p}]}+1$
$$L^{[\mathfrak{p}]}(t)={2t\sqrt{C^{[\mathfrak{p}]}(t^2)}(t^{2n_1^{[\mathfrak{p}]}}-C^{[\mathfrak{p}]}(t^2))
\over \sqrt{ Q(t) }\left((1-2t)C^{[\mathfrak{p}]}(t^2)+2t^{n_0^{[\mathfrak{p}]} +n_1^{[\mathfrak{p}]}}
- \sqrt{C^{[\mathfrak{p}]}(t^2) Q(t) } \right)}, $$
where $Q(t)=(1-4t^2)C^{[\mathfrak{p}]}(t^2)+4t^{2n_0^{[\mathfrak{p}]}};$

\item if $n_1^{[\mathfrak{p}]}=n_0^{[\mathfrak{p}]}$
$$L^{[\mathfrak{p}]}(t)=
{2tC^{[\mathfrak{p}]}(t^2)^2 \over \sqrt{ Q(t)
}\left((2t-1)C(t^2)-t^{2n_0^{[\mathfrak{p}]}} + \sqrt{ Q(t) } \right)}, $$
where
$Q(t)=(1-4t^2)C^{[\mathfrak{p}]}(t^2)^2+2t^{2n_0^{[\mathfrak{p}]}}C^{[\mathfrak{p}]}(t^2)+t^{4n_0^{[\mathfrak{p}]}}$.

\end{itemize}
\end{theorem}
\begin{proof}
For the proof we can observe that the application of generating function $R^{[\mathfrak{p}]}(t, w)$ as
\begin{displaymath}
 R^{[\mathfrak{p}]}\left(tw,{1 \over w}\right)=\sum_{n,k\in\mathbb{N}} R_{n, k}^{[\mathfrak{p}]}t^n w^{n-k}
\end{displaymath}
entails that $[t^{r}w^{s}]R^{[\mathfrak{p}]}\left(tw,{1 \over w}\right)=R_{r,
r-s}^{[\mathfrak{p}]}$, which is the number of binary words with $r$ $1$-bits
and $s$ $0$-bits.  To enumerate according to the length let $t=w$, therefore
$L^{[\mathfrak{p}]}(t)=\sum_{n\geq
0}L_n^{[\mathfrak{p}]}t^n=R^{[\mathfrak{p}]}(t^2,1/t)$. The statement of the
theorem can be found after some algebraic simplification.
\end{proof}

Theorems \ref{teo2} and \ref{teo3} allow us to find the generating functions $S^{[\mathfrak{p}]}(t)$ and $L^{[\mathfrak{p}]}(t)$
 in terms of the autocorrelation polynomial for every Riordan pattern $\mathfrak{p}$.
 In what follows, we study some special classes of patterns characterized by an autocorrelation polynomial that can be easily computed, as
 in the case $C^{[\mathfrak{p}]}(x,y)=1$.
For such particular patterns, Theorem \ref{teo1} can be simplified as follows:
\begin{corollary}
\label{corodh}
Let  ${\cal{R}^{[\mathfrak{p}]}}=(R_{n, k}^{[\mathfrak{p}]})_{n,k\in\mathbb{N}}=(d^{[\mathfrak{p}]}(t),h^{[\mathfrak{p}]}(t))$  be the
Riordan array corresponding to the number of binary words with $n$ $1$-bits  and
$n-k$  $0$-bits  that avoid the Riordan pattern $\mathfrak{p}$.   Then we have
the following particular cases:
\begin{itemize}

\item for $\mathfrak{p}=1^{j+1}0^j$ we have the Riordan array
$$ d^{[\mathfrak{p}]}(t)={1 \over \sqrt{1-4t+4t^{j+1}}}, \quad h^{[\mathfrak{p}]}(t)={1 -\sqrt{1-4t+4t^{j+1}} \over 2 };$$

\item $\mathfrak{p}=0^{j+1}1^j$ we have the Riordan array
$$ d^{[\mathfrak{p}]}(t)={1 \over \sqrt{1-4t+4t^{j+1}}}, \quad h^{[\mathfrak{p}]}(t)={1 -\sqrt{1-4t+4t^{j+1}} \over 2(1-t^j) };$$

\item $\mathfrak{p}=1^{j}0^j$ and $\mathfrak{p}=0^{j}1^j$ we have the Riordan array
$$ d^{[\mathfrak{p}]}(t)={1 \over \sqrt{1-4t+2t^j+t^{2j}}}, \quad h^{[\mathfrak{p}]}(t)={{1+t^j -\sqrt{1-4t+2t^j+t^{2j}} } \over 2 };$$

\item $\mathfrak{p}=(10)^j1$ we have the Riordan array
\begin{displaymath}
\begin{split}
d^{[\mathfrak{p}]}(t) &amp;= { \sum_{i=0}^j t^i \over \sqrt{1-2\sum_{i=1}^jt^i-3 \left( \sum_{i=1}^j t^i \right)^2}},\\
h^{[\mathfrak{p}]}(t) &amp;= {\sum_{i=0}^jt^i -\sqrt{1-2\sum_{i=1}^jt^i-3\left( \sum_{i=1}^j t^i \right)^2} \over 2 \sum_{i=0}^jt^i};
\end{split}
\end{displaymath}

\item $\mathfrak{p}=(01)^j0$ we have the Riordan array
\begin{displaymath}
\begin{split}
d^{[\mathfrak{p}]}(t) &amp;= { \sum_{i=0}^j t^i \over \sqrt{1-2\sum_{i=1}^jt^i-3 \left( \sum_{i=1}^j t^i \right)^2}},\\
h^{[\mathfrak{p}]}(t) &amp;= {\sum_{i=0}^jt^i -\sqrt{1-2\sum_{i=1}^jt^i-3\left( \sum_{i=1}^j t^i \right)^2} \over 2 \sum_{i=0}^{j-1}t^i}.
\end{split}
\end{displaymath}

\end{itemize}
\end{corollary}

As a peculiar instance, observe that when we instantiate a pattern from family
$\mathfrak{p}=1^{j}0^{j}$ with $j=1$ we get a Riordan array
${\mathcal{R}^{[10]}} = \left(d^{[10]}(t), h^{[10]}(t)\right)$ such that
\begin{displaymath} d^{[10]}(t)=\frac{1}{1-t} \quad \text{and} \quad
h^{[10]}(t) = t, \end{displaymath} so the number $R_{n, 0}^{[10]}$ of words
containing $n$ $1$-bits  and $n$ $0$-bits, avoiding pattern $\mathfrak{p}=10$, is
$[t^{n}] d^{[10]}(t) = 1$ for $n\in\mathbb{N}$. If we consider the
combinatorial interpretation of $R_{n,0}^{[\mathfrak{p}]}$ as lattice paths as
illustrated in the last paragraph of the Introduction, this
corresponds to the fact that there is exactly one \emph{valley}-shaped path having $n$ steps of both
kinds $\diagup$ and $\diagdown$, avoiding $\mathfrak{p}=10$ and terminating at
coordinate $(2n, 0)$ for each $n\in\mathbb{N}$, formally the path $0^{n}1^{n}$.

By applying Theorem \ref{teo2} to the same patterns as before, we get the following corollary.

\begin{corollary}
\label{coroS}
Let  $S^{[\mathfrak{p}]}(t)=\sum_{n\geq 0}S_n^{[\mathfrak{p}]}t^n$ the
generating function enumerating the set of binary words $\left\lbrace w\in
\lbrace 0,1 \rbrace^{*}: |w|_0\leq |w|_1\right\rbrace$ avoiding  a Riordan
pattern $\mathfrak{p}$ according to the number of $1$-bits. We have the
following particular cases:

\begin{itemize}

\item for $\mathfrak{p}=1^{j+1}0^j$ we have
$$ S^{[\mathfrak{p}]}(t)={2 \over \sqrt{1-4t+4t^{j+1}}\left(1+ \sqrt{1-4t+4t^{j+1}}\right) };$$

\item for $\mathfrak{p}=0^{j+1}1^j$ we have
$$ S^{[\mathfrak{p}]}(t)={2(1-t^j) \over \sqrt{1-4t+4t^{j+1}} \left(1-2t^j+ \sqrt{1-4t+4t^{j+1}}\right)};$$

\item for $\mathfrak{p}=1^{j}0^j$ and $\mathfrak{p}=0^{j}1^j$ we have
$$ S^{[\mathfrak{p}]}(t)={2 \over \sqrt{1-4t+2t^j+t^{2j}} \left(1-t^j+\sqrt{1-4t+2t^j+t^{2j}}  \right)};$$

\item for $\mathfrak{p}=(10)^j1$ we have
$$ S^{[\mathfrak{p}]}(t)={2 (1-t^{j+1})\over 1-4t+3t^{j+1}+\sqrt{1-4t+2t^{j+1}+4t^{j+2}-3t^{2j+2}}};$$

\item for $\mathfrak{p}=(01)^j0$ we have
$$ S^{[\mathfrak{p}]}(t)={2 (1-t^j-t^{j+1}+t^{2j+1})\over \sqrt{Q(t)} \left(1-2t^j+t^{j+1}+\sqrt{Q(t)}  \right)},$$
where $Q(t)={1-4t+2t^{j+1}+4t^{j+2}-3t^{2j+2}}$.

\end{itemize}
\end{corollary}
We observe that the case $\mathfrak{p}=(10)^j1$ in Corollary \ref{coroS}
corresponds to the sequence studied by Bilotta, Grazzini and Pergola \cite{BGP13}; moreover, in
Table \ref{tbl:S1_j1:0_j}, Table \ref{tbl:S0_j1:1_j}, Table \ref{tbl:S0_j:1_j},
Table \ref{tbl:S10_j:1} and Table \ref{tbl:S01_j:0} we report some expansions and some set of words related to the $S^{[\mathfrak{p}]}(t)$
functions just defined, respectively.

\begin{table}[H]
\begin{equation*}\begin{array}{c|cccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11\\\hline0 &amp; 1 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0\\1 &amp; 1 &amp; 3 &amp; 7 &amp; 15 &amp; 31 &amp; 63 &amp; 127 &amp; 255 &amp; 511 &amp; 1023 &amp; 2047 &amp; 4095\\2 &amp; 1 &amp; 3 &amp; 10 &amp; 32 &amp; 106 &amp; 357 &amp; 1222 &amp; 4230 &amp; 14770 &amp; 51918 &amp; 183472 &amp; 651191\\3 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 123 &amp; 442 &amp; 1611 &amp; 5931 &amp; 22010 &amp; 82187 &amp; 308427 &amp; 1162218\\4 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 459 &amp; 1696 &amp; 6330 &amp; 23806 &amp; 90068 &amp; 342430 &amp; 1307138\\5 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1713 &amp; 6415 &amp; 24205 &amp; 91874 &amp; 350406 &amp; 1341782\\6 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6432 &amp; 24290 &amp; 92273 &amp; 352212 &amp; 1349768\\7 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24307 &amp; 92358 &amp; 352611 &amp; 1351574\\8 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24310 &amp; 92375 &amp; 352696 &amp; 1351973\end{array}\end{equation*}

\begin{displaymath}
\begin{split}
[t^{3}]S^{[110]}(t) &amp;= \big|\lbrace 111, 0111, 1011, 00111, 01011, 10011, 10101, 000111, \\
&amp; 001011, 010011, 010101, 100011, 100101, 101001, 101010\rbrace\big| = 15
\end{split}
\end{displaymath}

\caption{Some expansions for $S^{[1^{j+1}0^j]}(t)$ and the set of
words with $n=3$ $1$-bits, avoiding pattern $\mathfrak{p}=110$, so $j=1$ in the
family; moreover, for $j=1$ the sequence corresponds to \seqnum{A000225}, for $j=2$ the
sequence corresponds to \seqnum{A261058}.}
\label{tbl:S1_j1:0_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|cccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11\\\hline0 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 3 &amp; 8 &amp; 20 &amp; 48 &amp; 112 &amp; 256 &amp; 576 &amp; 1280 &amp; 2816 &amp; 6144 &amp; 13312\\2 &amp; 1 &amp; 3 &amp; 10 &amp; 33 &amp; 111 &amp; 378 &amp; 1302 &amp; 4525 &amp; 15841 &amp; 55783 &amp; 197389 &amp; 701286\\3 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 124 &amp; 447 &amp; 1632 &amp; 6015 &amp; 22336 &amp; 83439 &amp; 313216 &amp; 1180511\\4 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 460 &amp; 1701 &amp; 6351 &amp; 23890 &amp; 90398 &amp; 343713 &amp; 1312108\\5 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1714 &amp; 6420 &amp; 24226 &amp; 91958 &amp; 350736 &amp; 1343069\\6 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6433 &amp; 24295 &amp; 92294 &amp; 352296 &amp; 1350098\\7 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24308 &amp; 92363 &amp; 352632 &amp; 1351658\\8 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24310 &amp; 92376 &amp; 352701 &amp; 1351994\end{array}\end{equation*}

\begin{displaymath}
    \hspace{-1.5cm}
    \begin{split}
    [t^{3}]S^{[001]}(t) &amp;= \big|\lbrace 111, 0111, 1011, 1101, 1110, 01011, 01101, 01110, 10101, 10110, 11010, 11100,\\
    &amp; 010101, 010110, 011010, 011100, 101010, 101100, 110100, 111000\rbrace\big| = 20
    \end{split}
\end{displaymath}

\caption{Some expansions for $S^{[0^{j+1}1^j]}(t)$ and the set of
words with $n=3$ $1$-bits, avoiding pattern $\mathfrak{p}=001$, so $j=1$ in the
family; moreover, for $j=1$ the sequence corresponds to \seqnum{A001792}.}
\label{tbl:S0_j1:1_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|cccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11\\\hline0 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24310 &amp; 92378 &amp; 352716 &amp; 1352078\\1 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12\\2 &amp; 1 &amp; 3 &amp; 9 &amp; 27 &amp; 82 &amp; 253 &amp; 791 &amp; 2499 &amp; 7960 &amp; 25520 &amp; 82248 &amp; 266221\\3 &amp; 1 &amp; 3 &amp; 10 &amp; 34 &amp; 118 &amp; 417 &amp; 1493 &amp; 5400 &amp; 19684 &amp; 72196 &amp; 266122 &amp; 985003\\4 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 125 &amp; 454 &amp; 1671 &amp; 6211 &amp; 23261 &amp; 87641 &amp; 331821 &amp; 1261398\\5 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 461 &amp; 1708 &amp; 6390 &amp; 24086 &amp; 91328 &amp; 347965 &amp; 1331072\\6 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1715 &amp; 6427 &amp; 24265 &amp; 92154 &amp; 351666 &amp; 1347326\\7 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6434 &amp; 24302 &amp; 92333 &amp; 352492 &amp; 1351028\\8 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24309 &amp; 92370 &amp; 352671 &amp; 1351854\end{array}\end{equation*}

\begin{displaymath}
    \hspace{-1.5cm}
    \begin{split}
    [t^{8}]S^{[01]}(t) &amp;= \big|\lbrace 11111111, 111111110, 1111111100, 11111111000, 111111110000,\\
    &amp; 1111111100000, 11111111000000, 111111110000000, 1111111100000000\rbrace\big| = 9
    \end{split}
\end{displaymath}

\caption{Some expansions for $S^{[0^{j}1^j]}(t)$ (or, equivalently,
$S^{[1^{j}0^{j}]}(t)$) and the set of words with $n=8$ $1$-bits, avoiding pattern
$\mathfrak{p}=01$ (or, equivalently, $\mathfrak{p}=10$), so $j=1$ in the family; moreover,
for $j=0$ the sequence corresponds to \seqnum{A001700}, for $j=1$ the sequence corresponds to  \seqnum{A001477}.}
\label{tbl:S0_j:1_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|cccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11\\\hline0 &amp; 1 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0\\1 &amp; 1 &amp; 3 &amp; 7 &amp; 18 &amp; 48 &amp; 131 &amp; 363 &amp; 1017 &amp; 2873 &amp; 8169 &amp; 23349 &amp; 67024\\2 &amp; 1 &amp; 3 &amp; 10 &amp; 32 &amp; 109 &amp; 377 &amp; 1324 &amp; 4697 &amp; 16795 &amp; 60425 &amp; 218485 &amp; 793259\\3 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 123 &amp; 445 &amp; 1631 &amp; 6036 &amp; 22511 &amp; 84460 &amp; 318438 &amp; 1205457\\4 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 459 &amp; 1699 &amp; 6350 &amp; 23911 &amp; 90572 &amp; 344737 &amp; 1317397\\5 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1713 &amp; 6418 &amp; 24225 &amp; 91979 &amp; 350910 &amp; 1344092\\6 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6432 &amp; 24293 &amp; 92293 &amp; 352317 &amp; 1350272\\7 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24307 &amp; 92361 &amp; 352631 &amp; 1351679\\8 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24310 &amp; 92375 &amp; 352699 &amp; 1351993\end{array}\end{equation*}

\begin{displaymath}
    \hspace{-1.5cm}
    \begin{split}
    [t^{3}]S^{[101]}(t) &amp;= \big|\lbrace 111, 0111, 1110, 00111, 01110, 10011, 11001, 11100, 000111, 001110,\\
    &amp; 010011, 011001, 011100, 100011, 100110, 110001, 110010, 111000 \rbrace\big| = 18
    \end{split}
\end{displaymath}

\caption{Some expansions for $S^{[(10)^{j}1]}(t)$ and the set of words
with $n=3$ $1$-bits, avoiding pattern $\mathfrak{p}=101$, so $j=1$ in the family;
moreover, for $j=1$ the sequence corresponds to \seqnum{A225034}.}
\label{tbl:S10_j:1}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|cccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11\\\hline0 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 3 &amp; 8 &amp; 22 &amp; 61 &amp; 171 &amp; 483 &amp; 1373 &amp; 3923 &amp; 11257 &amp; 32418 &amp; 93644\\2 &amp; 1 &amp; 3 &amp; 10 &amp; 33 &amp; 113 &amp; 393 &amp; 1384 &amp; 4920 &amp; 17618 &amp; 63456 &amp; 229642 &amp; 834342\\3 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 124 &amp; 449 &amp; 1647 &amp; 6099 &amp; 22754 &amp; 85394 &amp; 322022 &amp; 1219205\\4 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 460 &amp; 1703 &amp; 6366 &amp; 23974 &amp; 90818 &amp; 345691 &amp; 1321092\\5 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1714 &amp; 6422 &amp; 24241 &amp; 92042 &amp; 351156 &amp; 1345049\\6 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6433 &amp; 24297 &amp; 92309 &amp; 352380 &amp; 1350518\\7 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24308 &amp; 92365 &amp; 352647 &amp; 1351742\\8 &amp; 1 &amp; 3 &amp; 10 &amp; 35 &amp; 126 &amp; 462 &amp; 1716 &amp; 6435 &amp; 24310 &amp; 92376 &amp; 352703 &amp; 1352009\end{array}\end{equation*}

\begin{displaymath}
    \hspace{-1.5cm}
    \begin{split}
    [t^{3}]S^{[010]}(t) &amp;= \big|\lbrace 111, 0111, 1011, 1101, 1110, 00111, 01101, 01110, \\
            &amp; 10011, 10110, 11001, 11100, 000111, 001101, 001110, 011001, \\
            &amp; 011100, 100011, 100110, 101100, 110001, 111000 \rbrace\big| = 22
    \end{split}
\end{displaymath}

\caption{Some expansions for $S^{[(01)^{j}0]}(t)$ and the set of words
with $n=3$ $1$-bits, avoiding pattern $\mathfrak{p}=010$, so $j=1$ in the family;
moreover, for $j=1$ the sequence corresponds to \seqnum{A025566}.}
\label{tbl:S01_j:0}
\end{table}


Finally, by applying Theorem \ref{teo3} to the pattern families already examined, we find the following result.
\begin{corollary}
\label{coroL}
Let  $L^{[\mathfrak{p}]}(t)=\sum_{n\geq 0}L_n^{[\mathfrak{p}]}t^n$ the
generating function enumerating the set of binary words $\left\lbrace w\in
\lbrace 0,1 \rbrace^{*}: |w|_0\leq |w|_1\right\rbrace$ avoiding  a Riordan
pattern $\mathfrak{p}$ according to the length. We have the following
particular cases:
\begin{itemize}

\item for $\mathfrak{p}=1^{j+1}0^j$ we have
$$ L^{[\mathfrak{p}]}(t)={2t \over \sqrt{1-4t^2+4t^{2(j+1)}}\left(2t-1+ \sqrt{1-4t^2+4t^{2(j+1)}}\right) };$$

\item for $\mathfrak{p}=0^{j+1}1^j$ we have
$$ L^{[\mathfrak{p}]}(t)={2t(t^{2j}-1) \over \sqrt{1-4t^2+4t^{2(j+1)}} \left(1-2t+2t^{2j+1} -\sqrt{1-4t^2+4t^{2(j+1)}}\right)};$$

\item for $\mathfrak{p}=1^{j}0^j$ and $\mathfrak{p}=0^{j}1^j$ we have:
$$ L^{[\mathfrak{p}]}(t)={2 t \over \sqrt{1-4t^2+2t^{2j}+t^{4j}} \left(-1+2t-t^{2j}+\sqrt{1-4t^{2}+2t^{2j}+t^{4j}}  \right)};$$

\item for $\mathfrak{p}=(10)^j1$ we have
$$ L^{[\mathfrak{p}]}(t)={2 t (t^{2j+2}-1)\over 1-4t^2+3t^{2j+2}+(2t-1)\sqrt{Q(t)} };$$

\item for $\mathfrak{p}=(01)^j0$ we have
$$ L^{[\mathfrak{p}]}(t)={2 t (t^{2j+2}-1)(t^{2j}-1)\over  \sqrt{Q(t)} (t^{2j+2}-2t^{2j+1}+2t-1+ \sqrt{Q(t)}) },$$

\end{itemize}
where $Q(t)={1-4t^2+2t^{2j+2}+4t^{2j+4}-3t^{4j+4}}$.
\end{corollary}

In Table \ref{tbl:L1_j1:0_j}, Table \ref{tbl:L0_j1:1_j}, Table \ref{tbl:L0_j:1_j},
Table \ref{tbl:L10_j:1} and Table \ref{tbl:L01_j:0} we report some expansions related to the $L^{[\mathfrak{p}]}(t)$ functions just defined,
respectively.

\begin{table}[H]
\begin{equation*}\begin{array}{c|ccccccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12 &amp; 13 &amp; 14\\\hline0 &amp; 1 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0\\1 &amp; 1 &amp; 1 &amp; 3 &amp; 3 &amp; 7 &amp; 7 &amp; 15 &amp; 15 &amp; 31 &amp; 31 &amp; 63 &amp; 63 &amp; 127 &amp; 127 &amp; 255\\2 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 15 &amp; 38 &amp; 55 &amp; 135 &amp; 201 &amp; 483 &amp; 736 &amp; 1742 &amp; 2699 &amp; 6313\\3 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 63 &amp; 159 &amp; 247 &amp; 610 &amp; 969 &amp; 2354 &amp; 3802 &amp; 9117\\4 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 255 &amp; 634 &amp; 1015 &amp; 2482 &amp; 4041 &amp; 9752\\5 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1023 &amp; 2506 &amp; 4087 &amp; 9880\\6 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4095 &amp; 9904\\7 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9908\end{array}\end{equation*}
\caption{Some expansions for $L^{[1^{j+1}0^j]}(t)$; moreover, for
$j=1$ the sequence corresponds to \seqnum{A052551}.}
\label{tbl:L1_j1:0_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|ccccccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12 &amp; 13 &amp; 14\\\hline0 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 9 &amp; 13 &amp; 26 &amp; 39 &amp; 73 &amp; 112 &amp; 201 &amp; 313 &amp; 546 &amp; 859 &amp; 1469\\2 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 40 &amp; 61 &amp; 147 &amp; 231 &amp; 542 &amp; 870 &amp; 2004 &amp; 3269 &amp; 7423\\3 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 161 &amp; 253 &amp; 622 &amp; 999 &amp; 2414 &amp; 3942 &amp; 9396\\4 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 636 &amp; 1021 &amp; 2494 &amp; 4071 &amp; 9812\\5 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2508 &amp; 4093 &amp; 9892\\6 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9906\\7 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9908\end{array}\end{equation*}
\caption{Some expansions for $L^{[0^{j+1}1^j]}(t)$; moreover, for
$j=1$ the sequence corresponds to \seqnum{A079284}.}
\label{tbl:L0_j1:1_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|ccccccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12 &amp; 13 &amp; 14\\\hline0 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9908\\1 &amp; 1 &amp; 1 &amp; 2 &amp; 2 &amp; 3 &amp; 3 &amp; 4 &amp; 4 &amp; 5 &amp; 5 &amp; 6 &amp; 6 &amp; 7 &amp; 7 &amp; 8\\2 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 10 &amp; 14 &amp; 33 &amp; 48 &amp; 109 &amp; 163 &amp; 362 &amp; 552 &amp; 1207 &amp; 1868 &amp; 4036\\3 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 41 &amp; 62 &amp; 154 &amp; 240 &amp; 583 &amp; 928 &amp; 2217 &amp; 3587 &amp; 8459\\4 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 162 &amp; 254 &amp; 629 &amp; 1008 &amp; 2455 &amp; 4000 &amp; 9614\\5 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 637 &amp; 1022 &amp; 2501 &amp; 4080 &amp; 9853\\6 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2509 &amp; 4094 &amp; 9899\\7 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9907\end{array}\end{equation*}
\caption{Some expansions for $L^{[0^{j}1^j]}(t)$ (or, equivalently,
$L^{[1^{j}0^j]}(t)$); moreover, for $j=0$ the sequence corresponds to \seqnum{A027306},
for $j=1$ the sequence corresponds to \seqnum{A008619}.}
\label{tbl:L0_j:1_j}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|ccccccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12 &amp; 13 &amp; 14\\\hline0 &amp; 1 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 &amp; 0\\1 &amp; 1 &amp; 1 &amp; 3 &amp; 3 &amp; 7 &amp; 8 &amp; 19 &amp; 23 &amp; 53 &amp; 66 &amp; 150 &amp; 191 &amp; 429 &amp; 555 &amp; 1235\\2 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 15 &amp; 38 &amp; 56 &amp; 139 &amp; 210 &amp; 511 &amp; 790 &amp; 1892 &amp; 2973 &amp; 7034\\3 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 63 &amp; 159 &amp; 248 &amp; 614 &amp; 978 &amp; 2382 &amp; 3857 &amp; 9273\\4 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 255 &amp; 634 &amp; 1016 &amp; 2486 &amp; 4050 &amp; 9780\\5 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1023 &amp; 2506 &amp; 4088 &amp; 9884\\6 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4095 &amp; 9904\\7 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9908\end{array}\end{equation*}
\caption{Some expansions for $L^{[(10)^{j}1]}(t)$; moreover, no
sequence is known in the literature, except for $j=0$.}
\label{tbl:L10_j:1}
\end{table}

\begin{table}[H]
\begin{equation*}\begin{array}{c|ccccccccccccccc}j/n &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp; 5 &amp; 6 &amp; 7 &amp; 8 &amp; 9 &amp; 10 &amp; 11 &amp; 12 &amp; 13 &amp; 14\\\hline0 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1 &amp; 1\\1 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 9 &amp; 13 &amp; 28 &amp; 42 &amp; 87 &amp; 134 &amp; 271 &amp; 425 &amp; 844 &amp; 1342 &amp; 2628\\2 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 40 &amp; 61 &amp; 149 &amp; 234 &amp; 558 &amp; 895 &amp; 2098 &amp; 3420 &amp; 7909\\3 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 161 &amp; 253 &amp; 624 &amp; 1002 &amp; 2430 &amp; 3967 &amp; 9492\\4 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 636 &amp; 1021 &amp; 2496 &amp; 4074 &amp; 9828\\5 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2508 &amp; 4093 &amp; 9894\\6 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9906\\7 &amp; 1 &amp; 1 &amp; 3 &amp; 4 &amp; 11 &amp; 16 &amp; 42 &amp; 64 &amp; 163 &amp; 256 &amp; 638 &amp; 1024 &amp; 2510 &amp; 4096 &amp; 9908\end{array}\end{equation*}
\caption{Some expansions for $L^{[(01)^{j}0]}(t)$; moreover, no
sequence is known in literature, except for $j=0$.}
\label{tbl:L01_j:0}
\end{table}


\section{Some combinatorial interpretations}

In the previous section we proved results about the enumeration of words
avoiding patterns from an algebraic point of view. The aim of this section is
to analyze in more details some particular cases of the various pattern
families. We approach these problems either combinatorially by providing an interpretation, or algebraically by
computing the coefficients of the involved generating functions explicitly.

\subsection{Enumeration with respect to the number of $1$-bits}

\begin{corollary}
\label{coro:1_j1_0_j}
Consider pattern $\mathfrak{p}=1^{j+1}0^{j}$. There is only one word in
$\mathfrak{L}^{[\mathfrak{p}]}$ for $j=0$; on the other hand, there are
$S_{n}^{[\mathfrak{p}]} = 2^{n+1}-1$ words for $j=1$.
\end{corollary}

\begin{proof}
When $j=0$ the pattern to avoid is $\mathfrak{p}=1$, therefore only words
$w$ in $ \lbrace \varepsilon \rbrace\cup\lbrace 0 \rbrace^{+}$ are suitable choices;
however, the constraint $|w|_{0} \leq |w|_{1}$ makes $w = \varepsilon$ the only one.

When $j=1$ the pattern to avoid is $\mathfrak{p}=110$ and we observe that the
generic binomial ${{ {r}\choose{k}}}$ can be interpreted as the number of
binary words with $r$ $0$-bits  containing $k$ occurrences of the substring
$10$, which we call an \emph{inversion} with respect to pattern $\mathfrak{p}=110$.
In order to build a word in the language we start from the substring $0^{r}$ for
$r\in\lbrace 0,\ldots,n\rbrace$ and select $k\in \lbrace 0, \ldots,r
\rbrace$ $0$-bits, transforming each one using the mapping $0 \mapsto 10$,
while preventing the transformation of the $0$-bit in the $10$ just introduced. This
maneuver introduces $k$ inversions and the selection can be done in ${{
{r}\choose{k}}}$ ways; finally, we pad on the right with a strip $1^{n-k}$,  because it is mandatory for a word to have $n$
$1$-bits. Hence there is one padding for each set of inversions and there is no other way to avoid $\mathfrak{p}$. Therefore
\begin{displaymath}
     \sum_{r=0}^{n}{\sum_{k=0}^{r}{{ {r}\choose{k}}}} = 2^{n+1}-1 = S_{n}^{[\mathfrak{p}]},
\end{displaymath}
as can be verified algebraically by extracting the coefficient of the generating function
$$S^{[\mathfrak{p}]}(t)={1 \over 1-3t+2t^2}={2 \over 1-2t}-{1 \over 1-t},$$
as required.
\end{proof}


The same argument can be rewritten in term of sets, which allows us to give a constructive approach.
Let $\mathcal{S}_{n, k, i}$ be the set of binary words containing
$n$ and $k$ occurrences of $1$-bits  and $0$-bits, respectively, with $i$ inversions,
namely an occurrence of the subsequence $10$.
By union with respect to $i$ and $k$, we get the sets $\mathcal{S}_{n,
k}^{[\mathfrak{p}]}$ and $\mathcal{S}_{n}^{[\mathfrak{p}]}$, formally
\begin{displaymath}
    \mathcal{S}_{n}^{[\mathfrak{p}]} =
        \bigcup_{k\in \lbrace 0,\ldots,n \rbrace} {\mathcal{S}_{n, k}^{[\mathfrak{p}]}} =
        \bigcup_{i\in \lbrace 0,\ldots,k \rbrace} {\mathcal{S}_{n, k, i}^{[\mathfrak{p}]}} =
         {\left(\bigcup_{i\in \lbrace 0,\ldots,k \rbrace}{
                    \mathcal{S}_{k, k, i}^{[\mathfrak{p}]}}\right)\times \left\lbrace 1^{n-k} \right\rbrace} .
\end{displaymath}
For the sake of clarity, we enumerate all binary words avoiding $\mathfrak{p}=110$
containing $n=3$ $1$-bits, formally we partition $\mathcal{S}_{3}^{[\mathfrak{p}]}$ as follows:
\begin{displaymath}
    \begin{split}
        \mathcal{S}_{3}^{[\mathfrak{p}]} &amp;= \mathcal{S}_{0, 0, 0}^{[\mathfrak{p}]}\times\lbrace 111 \rbrace\\
            &amp;\cup{\left(\mathcal{S}_{1, 1, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{1, 1, 1}^{[\mathfrak{p}]}\right)\times \lbrace 11 \rbrace}\\
            &amp;\cup{\left(\mathcal{S}_{2, 2, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{2, 2, 1}^{[\mathfrak{p}]}\cup\mathcal{S}_{2, 2, 2}^{[\mathfrak{p}]}\right)\times \lbrace 1 \rbrace}\\
            &amp;\cup{\left(\mathcal{S}_{3, 3, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 1}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 2}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 3}^{[\mathfrak{p}]}\right)\times \lbrace \varepsilon \rbrace}\\
    \end{split}
\end{displaymath}
where
\begin{displaymath}
\begin{split}
    \mathcal{S}_{3, 0}^{[\mathfrak{p}]}=\mathcal{S}_{0, 0, 0}^{[\mathfrak{p}]}\times\lbrace 111 \rbrace &amp;= \lbrace \varepsilon \rbrace\times\lbrace 111 \rbrace= \{111\}\\
    \mathcal{S}_{3, 1}^{[\mathfrak{p}]}={\left(\mathcal{S}_{1, 1, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{1, 1, 1}^{[\mathfrak{p}]}\right)\times \lbrace 11 \rbrace} &amp;= \{0111\}\cup\{1011\}\\
    \mathcal{S}_{3, 2}^{[\mathfrak{p}]}={\left(\mathcal{S}_{2, 2, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{2, 2, 1}^{[\mathfrak{p}]}\cup\mathcal{S}_{2, 2, 2}^{[\mathfrak{p}]}\right)\times \lbrace 1 \rbrace} &amp;=\{00111\}\cup\{10011, 01011\}\cup\{10101\}\\
    \mathcal{S}_{3, 3}^{[\mathfrak{p}]}={\left(\mathcal{S}_{3, 3, 0}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 1}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 2}^{[\mathfrak{p}]}\cup\mathcal{S}_{3, 3, 3}^{[\mathfrak{p}]}\right)\times \lbrace \varepsilon \rbrace} &amp;= \{000111\}\cup\{001011, 100011, 010011\} \\
            &amp;\cup\{101001, 100101, 010101\}\cup\{101010\},
\end{split}
\end{displaymath}
the same set of words shown in Table \ref{tbl:S1_j1:0_j}.

\begin{corollary}
\label{coro:0_j1_1_j}
Consider pattern $\mathfrak{p}=0^{j+1}1^{j}$. There is one word
$S_{n}^{[\mathfrak{p}]} = 1$ for each $n\in\mathbb{N}$ in
$\mathfrak{L}^{[\mathfrak{p}]}$ when $j=0$; on the other hand, there are
$(n+2)2^{n-1}$ words for $j=1$.
\end{corollary}

\begin{proof}
When $j=0$ the pattern to avoid is $\mathfrak{p}=0$, therefore only words
$w = 1^{n}$ are suitable. Hence there is one of them for each $n\in\mathbb{N}$.

When $j=1$ the pattern to avoid is $\mathfrak{p}=001$, therefore we
extract the $n$-th coefficient after instantiation of the corresponding
generating function:
\begin{displaymath}
[t^{n}] S_{n}^{[\mathfrak{p}]}(t) = [t^{n}]\frac{1-t}{(1-2t)^{2}} = (n+2)2^{n-1},
\end{displaymath}
as required.

We also provide a combinatorial interpretation of the theorem; first of all,
we observe that sequence $S_{n}^{[\mathfrak{p}]}$ is the binomial transform of
the sequence of the positive integers $(n+1)_{n\in\mathbb{N}}$, formally
\begin{displaymath}
    S_{n}^{[\mathfrak{p}]} =(n+2)2^{n-1}= \sum_{k=0}^{n}{{ {n}\choose{k}}(k+1)},
\end{displaymath}
where the generic summand ${{ {n}\choose{k}}(k+1)}$ can be interpreted as the number
of binary words with $n$ $1$-bits  containing $n-k$ occurrences of the substring $01$,
which we call an \emph{inversion} respect to the pattern $\mathfrak{p}=001$. We construct the set of
words avoiding $\mathfrak{p}$ to show the bijection with the previous assertion as follows:
if in a word $w$ there are $n-k$ occurrences of the substring $01$ then $w$ contains
$2n-2k$ bits in total, $n-k$ of both kinds. Since it is mandatory that the number
of $1$ is $n$, we add $k$ $1$-bits  to it, resulting in a new word $w'$ of length $2n-k$,
which can be augmented with at most $k$ additional $0$-bits,
according to the constraint $|w'|_{0}\leq |w'|_{1}$. In order to build a word with the structure of $w'$,
we start from the substring $1^{n}$ and select $n-k$ $1$-bits, transforming each one using
the mapping $1 \mapsto 01$, simultaneously to prevent transforming $1$-bit  in $01$ just introduced. This
maneuver introduces $n-k$ inversions and the selection can be done in ${{ {n}\choose{k}}}$ ways;
moreover, we are free to pad on the right with $0^{i}$ strips, for $i\in\lbrace 0,\ldots,k\rbrace,$
hence there are $k+1$ paddings for each set of inversions. Therefore, since there can be up to $n$ inversions,
\begin{displaymath}
    \sum_{k=0}^{n}{{ {n}\choose{n-k}}(k+1)} = (n+2)2^{n-1}
\end{displaymath}
concludes the proof by symmetry of binomial coefficients.
\end{proof}

\begin{corollary}
Consider pattern $\mathfrak{p}=0^{j}1^{j}$ (or, equivalently,
$\mathfrak{p}=1^{j}0^{j}$). There are
\begin{displaymath}
S_{n}^{[\mathfrak{p}]}=\sum_{k=0}^{n}{{{n+k}\choose{k}}}={{2n+1}\choose{n}}
\end{displaymath}
words in $\mathfrak{L}^{[\mathfrak{p}]}$ for $j=0$; on the other hand, there
are $S_{n}^{[\mathfrak{p}]} = n+1$ words for $j=1$.
\end{corollary}

\begin{proof}
When $j=0$ there is no pattern to avoid and this situation corresponds to the
enumeration of binary words $\left\lbrace w\in \lbrace 0,1 \rbrace^{*}: |w|_{0}
\leq |w|_{1}=n\right\rbrace$.  After instantiating the generating function
$S^{[\mathfrak{p}]}(t)$, we extract the $n$-th coefficient, as follows:
\begin{displaymath}
[t^{n}] S_{n}^{[\mathfrak{p}]}(t) =[t^{n}]\frac{1-\sqrt{1-4t}}{2t\sqrt{1-4t}}
= \frac{1}{2}{{2(n+1)}\choose{n+1}}
= {{2n+1}\choose{n+1}}
= {{2n+1}\choose{n}},
\end{displaymath}
which can be simplified by using the identity
\begin{displaymath}
{{r+s+1}\choose{s}} = \sum_{q=0}^{s}{{{r+q}\choose{q}}},
\end{displaymath}
as desired.
It is possible to state the following combinatorial interpretation:
since the maximum number of $0$-bits  is $n$, we reserve $n$ boxes for them. To the
left of each box reserve one more box and, finally, another one to the right of
the very last box. In this way we have reserved $2n+1$ boxes where we can put
$n$ $1$-bits  in ${{2n+1}\choose{n}}$ ways, as required.

When $j=1$ the pattern to avoid is $\mathfrak{p}=01$ (or, equivalently,
$\mathfrak{p}=10$), therefore only words $w \in   \lbrace 1^{n}
\rbrace\times\bigcup_{s\in \lbrace 0,\ldots,n \rbrace}\lbrace 0^{s} \rbrace$
are suitable, which are $n+1$, one for each value that $s$ can take.
\end{proof}

Last two patterns $\mathfrak{p}=(10)^{j}1$ and $\mathfrak{p}=(01)^{j}0$ are
harder to study: for $j=0$ there are $S_{n}^{[\mathfrak{p}]}=[\![n=0]\!]$ and
$S_{n}^{[\mathfrak{p}]}=1$ words, respectively.  On the other hand, when $j=1$
we report only the instantiated generating functions
\begin{displaymath}
\begin{split}
    S^{[\mathfrak{101}]}(t) &amp;=\frac{(1+t)\left(1-3t-\sqrt{1-2t-3t^{2}}\right)}{2t(3t-1)}, \\
    S^{[\mathfrak{010}]}(t) &amp;=\frac{1-2t-3t^{2}-(1-t)\sqrt{1-2t-3t^{2}}}{2t^{2}(3t-1)}.
\end{split}
\end{displaymath}
As pointed out by an anonymous referee, the
previous functions can be rewritten as
\begin{displaymath}
\begin{split}
    S^{[\mathfrak{101}]}(t) &amp;=\frac{(1+t)(1- t M(t))}{1-3t},\\
    S^{[\mathfrak{010}]}(t) &amp;=\frac{(1+t M(t))(1-t M(t))}{1-3t},
\end{split}
\end{displaymath}
where $M(t)=\frac{1 - t - \sqrt{1-2t-3t^{2}} }{2t^{2}}$ is the
Motzkin numbers' generating function. Such rewriting shows a relation among Motzkin numbers
and powers of $3$, which  is not easy to state  bijectively, to
the best of our knowledge.
However, for their generating functions, we have the following identity
\begin{equation}
\label{powers3}
{1 \over 1-3t}={M(t) \over (1-tM(t))^2},
\end{equation}
and thus, by using the fundamental rule of Riordan arrays (\ref{somme}), we can express the functions $S^{[\mathfrak{101}]}(t)$ and $S^{[\mathfrak{010}]}(t)$ in terms of the Motzkin triangle and the sequence $(1,2,2,2,\ldots)$
\begin{displaymath}
\begin{split}
    S^{[\mathfrak{101}]}(t) &amp;=\frac{(1+t)M(t)}{1- t M(t)}=\frac{(1+tM(t))^2}{1- t M(t)}=\left(1+tM(t),tM(t) \right) \ast {1+t \over 1-t},\\
    S^{[\mathfrak{010}]}(t) &amp;=\frac{(1+tM(t))M(t)}{1- t M(t)}= \left( M(t),tM(t)\right) \ast {1+t \over 1-t},
\end{split}
\end{displaymath}
as illustrated in Table \ref{Motzkin}.
\begin{table}[H]
$$
\begin{array}{c|cccccccc}
n/k  &amp; 0 &amp; 1 &amp; 2 &amp; 3 &amp; 4 &amp;5 &amp;6 &amp;7  \\ \cline{1-9}
0 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp;\\
1 &amp; 1 &amp; 1 &amp; &amp; &amp;  &amp; &amp; &amp;\\
2 &amp; 2&amp; 2 &amp; 1 &amp; &amp; &amp; &amp;  &amp;\\
3 &amp; 4 &amp; 5 &amp; 3 &amp; 1 &amp; &amp; &amp;  &amp;\\
4 &amp; 9 &amp; 12 &amp; 9 &amp; 4 &amp; 1&amp; &amp; &amp; \\
5 &amp; 21 &amp; 30 &amp; 25 &amp; 14 &amp; 5 &amp;1 &amp; &amp;\\
6 &amp; 51 &amp; 76 &amp; 69 &amp; 44 &amp; 20 &amp; 6&amp; 1 &amp;\\
7 &amp; 127 &amp; 196 &amp; 189 &amp; 133 &amp; 70 &amp; 27&amp; 7 &amp;1\\
\end{array}
$$
\caption{\label{Motzkin}The Motzkin triangle  corresponding to the Riordan array $\left(M(t),tM(t)\right)$ and to sequence \seqnum{A064189}.
Multiplying the matrix by the column vector $(1,2,2,2,2,\ldots )$ we get the sequence $S_{n}^{[\mathfrak{010}]}=(1,3,8,22,61, \cdots)$.
Similarly, with matrix $\left(1+tM(t),tM(t)\right)$ we get the sequence $S_{n}^{[\mathfrak{101}]}=(1, 3, 7, 18, 48, \cdots)$. }
\end{table}
Identity (\ref{powers3}) has a combinatorial interpretation in terms of compact-rooted directed animals
or domino towers (see Ardila \cite[Example 21, pp.~21--22]{Ardila} and the references therein); Motzkin triangle corresponds to sequence \seqnum{A064189} and has several combinatorial interpretations.



\subsection{Enumeration with respect to the length}

\begin{corollary}
Consider pattern $\mathfrak{p}=1^{j+1}0^{j}$. There is one word in
$\mathfrak{L}^{[\mathfrak{p}]}$ for $j=0$; on the other hand, there are
$2^{m+1}-1$ words, where $n=2m +  [\![\text{n is odd}]\!]$,  for $j=1$.
\end{corollary}

\begin{proof}
When $j=0$ the pattern to avoid is $\mathfrak{p}=1$, therefore
instantiating the generating function we have $L^{[\mathfrak{p}]}(t) = 1$, as
required.

When $j=1$ the pattern to avoid is $\mathfrak{p}=110$, therefore we instantiate
and extract the $n$-th coefficient
\begin{displaymath}
L_{n}^{[\mathfrak{p}]} = [t^{n}]\frac{2}{1-2t^{2}} + [t^{n-1}]\frac{2}{1-2t^{2}} - [t^{n}]\frac{1}{1-t}
\end{displaymath}
and proceed by cases on the parity of $n$. If $n=2m$ then the second term in
the rhs disappears, otherwise if $n=2m+1$ the first term disappears; in both
cases it is required to perform $[u^{m}]\frac{2}{1-2u} = 2^{m+1}$ where
$u=t^{2}$, as required.

It is possible to state a combinatorial interpretation using an argument
similar to the one given in the proof of Corollary \ref{coro:1_j1_0_j}.
Let $n=2m$, therefore a word $w$ needs to have $m+j$ $1$-bits, where $j\in
\lbrace 0,\ldots,m \rbrace$; conversely, $w$ needs to have $n-m-j=m-j$ $0$-bits.
Fixing $j$ in the given range, from the substring $0^{m-j}$ we select $i\in
\lbrace 0,\ldots,m-j \rbrace$ $0$-bits  to introduce $i$ inversions, namely $i$
occurrences of $10$, applying the mapping $0\mapsto 10$ simultaneously.  This
maneuver keeps the original $0$-bits  and introduces at most $m-j$ $1$-bits, so
we pad with $1$-bits  on the right in order to have the required $m+j$ $1$-bits
in the entire word; finally, selections can be done in
\begin{displaymath}
    \sum_{j=0}^{m}{\sum_{i=0}^{m-j}{ {{m-j}\choose{i}}} } =
    \sum_{j=0}^{m}{2^{m-j}} =
    2^{m+1}-1
\end{displaymath}
ways, because padding can be done in only one way,
completing the case for $n$ even.

Let $n=2m+1$, therefore a word $w$ needs to have $m+1+j$ $1$-bits, where $j\in
\lbrace 0,\ldots,m \rbrace$; conversely, $w$ needs to have $n-m-1-j=m-j$ $0$-bits.
Fixing $j$ in the given range, from the substring $0^{m-j}$ we select $i\in
\lbrace 0,\ldots,m-j \rbrace$ $0$-bits  to introduce $i$ inversions as done in
the even case, introducing at most $m-j$ $1$-bits,  and padding as necessary to have $m+1+j$
$1$-bits, the total number of selections
%\begin{displaymath}
    %\sum_{j=0}^{m}{\sum_{i=0}^{m-j}{ {{m-j}\choose{i}}} } =
    %\sum_{j=0}^{m}{2^{m-j}} =
    %2^{m+1}-1
%\end{displaymath}
equals the one given for the even case, completing the case for $n$ odd.
\end{proof}


\begin{corollary}
Consider pattern $\mathfrak{p}=0^{j+1}1^{j}$. There is one word
$L_{n}^{[\mathfrak{p}]} = 1$ for each $n\in\mathbb{N}$ in
$\mathfrak{L}^{[\mathfrak{p}]}$ when $j=0$; on the other hand, there are
$L_{n}^{[\mathfrak{p}]} = F_{n+3}-2^{m}$ words if $n=2m$ else
$L_{n}^{[\mathfrak{p}]} = F_{n+3}-2^{m+1}$ words if $n=2m+1$, for $j=1$, where
$F_{n}$ is the $n$-th Fibonacci number.
\end{corollary}

\begin{proof}
When $j=0$ the pattern to avoid is $\mathfrak{p}=0$, therefore suitable
words of length $n$ are of the form $w=1^{n}$. Hence $L_{n}^{[\mathfrak{p}]} =
1$ for each $n\in\mathbb{N}$.

When $j=1$ the pattern to avoid is $\mathfrak{p}=001$, therefore we instantiate and
extract the $n$-th coefficient
\begin{displaymath}
L_{n}^{[\mathfrak{p}]} = 2[t^{n+1}]\frac{t}{1-t-t^{2}} + [t^{n}]\frac{t}{1-t-t^{2}}
- [t^{n}]\frac{1}{1-2t^{2}} - 2[t^{n-1}]\frac{1}{1-2t^{2}}
\end{displaymath}
in order to have $L_{n}^{[\mathfrak{p}]} = 2F_{n+1} + F_{n} - a_{n} = F_{n+3} - a_{n}$,
where $a_{2m}=2^{m}$ and $a_{2m+1}=2^{m+1}$.

It is possible to state a combinatorial interpretation using an argument
similar to the one given in the proof of Corollary \ref{coro:0_j1_1_j}.
Let $n=2m$, therefore a word $w$ needs to have $m+j$ $1$-bits, where $j\in
\lbrace 0,\ldots,m \rbrace$; conversely, $w$ needs to have $n-m-j=m-j$ $0$-bits.
Fixing $j$ in the given range, from the substring $1^{m+j}$ we select $i\in
\lbrace 0,\ldots,m-j \rbrace$ $1$-bits  to introduce $i$ inversions, namely $i$
occurrences of $01$, applying the mapping $1\mapsto 01$ simultaneously.  This
maneuver keeps the original $1$-bits  and introduces at most $m-j$ $0$-bits;
finally, selections can be done in $\sum_{j=0}^{m}{\sum_{i=0}^{m-j}{
{{m+j}\choose{i}}} } $ ways. In order to find a closed form for the double
summation, we inspect the region of the Pascal triangle taken into account;
marking with $\circ$ the involved binomials
\begin{displaymath}
\begin{array}{c|cccccccccc}
n/j     &amp; 0 &amp; 1 &amp; \ldots &amp; m-1 &amp; m &amp; m+1 &amp; \ldots &amp; 2m-1 &amp; 2m &amp;  \ldots\\
\hline
0       &amp; \\
\vdots  &amp; \\
m-1     &amp; \\
m       &amp; \circ &amp; \circ &amp; \ldots &amp; \circ &amp; \circ \\
m+1     &amp; \circ &amp; \circ &amp; \ldots &amp; \circ \\
\vdots  &amp; \vdots &amp; \vdots &amp; \iddots \\
2m-1    &amp; \circ &amp; \circ \\
2m      &amp; \circ \\
2m+1    &amp; \\
\vdots  &amp; \\
\end{array}
\end{displaymath}
and using the identity ${ {r+1}\choose{k+1} }-{ {s}\choose{k+1} } = \sum_{i=s}^{r}{{ {i}\choose{k} }}$ for rearranging the summation and identities
$2^{n}=\sum_{i=0}^{n}{{ {n}\choose{i} }}$ and
$F_{n+1}=\sum_{i=0}^{n}{{ {n-i}\choose{i} }}$ to collect terms, we obtain
\begin{displaymath}
    \sum_{j=0}^{m}{\sum_{i=0}^{m-j}{ {{m+j}\choose{i}}} }
    = \sum_{k=0}^{m}{{ {2m+1-k}\choose{k+1} }-{ {m}\choose{k+1} }}
    = F_{2m+3}-2^{m} = L_{2m}^{[\mathfrak{p}]},
\end{displaymath}
completing the case for $n$ even.

Let $n=2m+1$, therefore a word $w$ needs to have $m+1+j$ $1$-bits, where $j\in
\lbrace 0,\ldots,m \rbrace$; conversely, $w$ needs to have $n-m-1-j=m-j$ $0$-bits.
Fixing $j$ in the given range, from the substring $1^{m+1+j}$ select
$i\in \lbrace 0,\ldots,m-j \rbrace$ $1$-bits  to introduce $i$ inversions as
done for the even case; in parallel, selections can be done in $
\sum_{j=0}^{m}{\sum_{i=0}^{m-j}{ {{m+1+j}\choose{i}}} } $ ways. The involved
region in the Pascal triangle has the same shape as the one shown for the even
case translated one row to the bottom, so binomials lying on row $m$ are
excluded and binomials ${ {2m+1-k}\choose{k} }$ are included, for $k\in \lbrace
0, \ldots, m \rbrace$.  Therefore we rewrite
\begin{displaymath}
    \sum_{j=0}^{m}{\sum_{i=0}^{m-j}{ {{m+1+j}\choose{i}}} }
    = \sum_{k=0}^{m}{{ {2m+2-k}\choose{k+1} }-{ {m+1}\choose{k+1} }}
    = F_{2m+4}-2^{m+1} = L_{2m+1}^{[\mathfrak{p}]},
\end{displaymath}
completing the case for $n$ odd.
\end{proof}

\begin{corollary}
Consider pattern $\mathfrak{p}=0^{j}1^{j}$ (or, equivalently,
$\mathfrak{p}=1^{j}0^{j}$). There are $2^{n-1}$ words in
$\mathfrak{L}^{[\mathfrak{p}]}$ if $n$ is odd else $2^{n-1}
+\frac{1}{2}{{2m}\choose{m}}$ where $n=2m$, for $j=0$; on the other hand, there
are $L_{n}^{[\mathfrak{p}]} = m+1$ words, where $n=2m +  [\![\text{n is
odd}]\!]$, for $j=1$.
\end{corollary}

\begin{proof}
When $j=0$ the pattern to avoid is $\mathfrak{p}=\varepsilon $, namely the
empty word, therefore instantiating the generating function we have
\begin{displaymath}
L^{[\mathfrak{p}]}(t) =\frac{1}{2(1-2t)} +\frac{1}{2\sqrt{1-4t^{2}}}
\end{displaymath}
we extract the coefficient $L_{n}^{[\mathfrak{p}]} = 2^{n-1} + \frac{a_{n}}{2}$,
where $a_{2m+1}=0$ and $a_{2m}={{2m}\choose{m}}$, as required. We observe that these values
correspond to the summation $\sum_{i=0}^m {n \choose i}$ for $n=2m,2m+1,\ldots,$
where the binomial coefficient computes the number of ways to choose $i$  $0$-bits among $n$ bits,
and this gives the combinatorial interpretation.

When $j=1$ the pattern to avoid is $\mathfrak{p}=01$ (or, equivalently,
$\mathfrak{p}=10$), therefore after instantiation
\begin{displaymath}
L^{[\mathfrak{p}]}(t) =\frac{1}{4(1-t)} + \frac{1}{2(1-t)^{2}} +\frac{1}{4(1+t)}
\end{displaymath}
we extract the $n$-th coefficient $L_{n}^{[\mathfrak{p}]} = \frac{1}{4} + \frac{(-1)^{n}}{4} +\frac{n+1}{2} $,
so either $n=2m$ or $n=2m+1$ entails $L_{n}^{[\mathfrak{p}]} = m+1$, as required.

A combinatorial interpretation can be given as follows: if $n=2m$ then suitable
words have structure $1^{m}1^{j}0^{m-j}$ for $j\in \lbrace 0, \ldots,m \rbrace$,
and there are $m+1$ of them. On the contrary, if $n=2m+1$ holds then suitable
words have structure $1^{m+1}1^{j}0^{m-j}$ for $j\in \lbrace 0, \ldots,m
\rbrace$, they are $m+1$ in number again, as required.
\end{proof}

As before, last two patterns $\mathfrak{p}=(01)^{j}0$ and
$\mathfrak{p}=(10)^{j}1$ are harder to study and we avoid to report formulas
about $L^{[\mathfrak{p}]}(t)$ functions because we have not a meaningful
combinatorial interpretation: we only point out that these functions can be
expressed in terms of $M(t^{2})$, where $M(t)$ is the generating function of
Motzkin numbers, similarly to the corresponding $S^{[\mathfrak{p}]}(t)$ functions.

\section{Conclusions}

As a final remark, we observe a structural properties of matrices
$\mathcal{R}^{[\mathfrak{p}]}$ against the studied families of patterns.
As it is well-known (see, e.g., Shapiro, Getu, Woan, and Woodson \cite{SGWW91}),
Riordan arrays constitute a group with respect to the usual row-by-column product between matrices,
and the product of two Riordan arrays $D_1$ and $D_2$ is defined as follows:
$$
  D_1 \ast D_2 = (d_1(t),\ h_1(t)) \ast (d_2(t),\ h_2(t)) =(d_1(t)d_2(h_1(t)),\ h_2(h_1(t))).
$$
Moreover, the Riordan array $I = (1,\ t)$ acts as the identity and the inverse of $D =(d(t), h(t))$ is the Riordan array:
$$
D^{-1} = \left( \frac{1}{d(\overline{h}(t))},
  \overline{h}(t) \right)
$$
where $\overline{h}(t)$ is the compositional inverse of $h(t)$.

The Pascal triangle and its inverse correspond to the Riordan arrays $$P
=\left(\frac{1}{1-t},\frac{t}{1-t}\right) \quad\quad
P^{-1}=\left(\frac{1}{1+t},\frac{t}{1+t}\right)$$ respectively.  Therefore, for
every Riordan array $\mathcal{R}^{[\mathfrak{p}]}$ we can compute
$B^{[\mathfrak{p}]}= P^{-1} \ast \mathcal{R}^{[\mathfrak{p}]},$, which is
equivalent to saying that  $\mathcal{R}^{[\mathfrak{p}]}$ is the binomial
transform of $B^{[\mathfrak{p}]},$ or $\mathcal{R}^{[\mathfrak{p}]}=P \ast
B^{[\mathfrak{p}]}$.

For the sake of clarity, consider the pattern family $\mathfrak{p}=1^{j+1}0^{j}$,
so for $j=1$ we have the minor
\begin{displaymath}
\mathcal{R}^{[110]} = \left[\begin{array}{ccccccccccc}1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\4 &amp; 2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp; \\64 &amp; 32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp;  &amp;  &amp; \\128 &amp; 64 &amp; 32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp;  &amp; \\256 &amp; 128 &amp; 64 &amp; 32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp;  &amp; \\512 &amp; 256 &amp; 128 &amp; 64 &amp; 32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1 &amp; \\1024 &amp; 512 &amp; 256 &amp; 128 &amp; 64 &amp; 32 &amp; 16 &amp; 8 &amp; 4 &amp; 2 &amp; 1\end{array}\right],
\end{displaymath}
which corresponds to
\begin{displaymath}
B^{[110]} = \left[\begin{array}{ccccccccccc}
1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 0 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 1 &amp; -1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 0 &amp; 2 &amp; -2 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 1 &amp; -2 &amp; 4 &amp; -3 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp; \\
1 &amp; 0 &amp; 3 &amp; -6 &amp; 7 &amp; -4 &amp; 1 &amp;  &amp;  &amp;  &amp; \\
1 &amp; 1 &amp; -3 &amp; 9 &amp; -13 &amp; 11 &amp; -5 &amp; 1 &amp;  &amp;  &amp; \\
1 &amp; 0 &amp; 4 &amp; -12 &amp; 22 &amp; -24 &amp; 16 &amp; -6 &amp; 1 &amp;  &amp; \\
1 &amp; 1 &amp; -4 &amp; 16 &amp; -34 &amp; 46 &amp; -40 &amp; 22 &amp; -7 &amp; 1 &amp; \\
1 &amp; 0 &amp; 5 &amp; -20 &amp; 50 &amp; -80 &amp; 86 &amp; -62 &amp; 29 &amp; -8 &amp; 1\end{array}\right]
\end{displaymath}
defined by functions $d^{[110]}(t)=\frac{1}{1-t}$ and
$h^{[110]}(t)=\frac{t}{1+t}$,
which expands to
$h^{[110]}(t) = t - t^{2} + t^{3} - t^{4} + t^{5} - t^{6} + t^{7} -
t^{8} + t^{9} - t^{10} + \mathcal{O}\left(t^{11}\right)$.

On the other hand, the Riordan array $\mathcal{R}^{[11100]}$, that is $j=2$ in
the family, is the binomial transform of
\begin{displaymath}
B^{[11100]} =\left[\begin{array}{ccccccccccc}1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\5 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\15 &amp; 7 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\31 &amp; 16 &amp; 9 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp; \\87 &amp; 43 &amp; 17 &amp; 11 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp; \\201 &amp; 101 &amp; 55 &amp; 18 &amp; 13 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp;  &amp; \\543 &amp; 271 &amp; 119 &amp; 67 &amp; 19 &amp; 15 &amp; 3 &amp; 1 &amp; 1 &amp;  &amp; \\1331 &amp; 666 &amp; 341 &amp; 141 &amp; 79 &amp; 20 &amp; 17 &amp; 3 &amp; 1 &amp; 1 &amp; \\3533 &amp; 1766 &amp; 826 &amp; 411 &amp; 167 &amp; 91 &amp; 21 &amp; 19 &amp; 3 &amp; 1 &amp; 1\end{array}\right]
\end{displaymath}
defined by functions $d^{[11100]}(t)=\sqrt\frac{1+t}{1-t-5t^{2}+t^{3}}$ and
$h^{[11100]}(t)=\frac{1+2t+t^{2}-\sqrt{(1-t-5t^{2}+t^{3})(1+t)}}{2(1+t)^{2}}$,
which expands to $h^{[11100]}(t)=t + 2 t^{4} - t^{5} + 7 t^{6} + 24 t^{8} + 17 t^{9} + 98 t^{10} +
\mathcal{O}\left(t^{11}\right)$.

\iffalse
Furthermore, the Riordan array $\mathcal{R}^{[1111000]}$, that is $j=3$ in the
family, is the binomial transform of
\begin{displaymath}
B^{[1111000]} =\left[\begin{array}{ccccccccccc}1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\3 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\7 &amp; 4 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\17 &amp; 8 &amp; 5 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp;  &amp; \\49 &amp; 25 &amp; 9 &amp; 6 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp;  &amp; \\123 &amp; 61 &amp; 34 &amp; 10 &amp; 7 &amp; 1 &amp; 1 &amp;  &amp;  &amp;  &amp; \\351 &amp; 176 &amp; 74 &amp; 44 &amp; 11 &amp; 8 &amp; 1 &amp; 1 &amp;  &amp;  &amp; \\945 &amp; 472 &amp; 242 &amp; 88 &amp; 55 &amp; 12 &amp; 9 &amp; 1 &amp; 1 &amp;  &amp; \\2641 &amp; 1321 &amp; 610 &amp; 322 &amp; 103 &amp; 67 &amp; 13 &amp; 10 &amp; 1 &amp; 1 &amp; \\7363 &amp; 3681 &amp; 1811 &amp; 766 &amp; 417 &amp; 119 &amp; 80 &amp; 14 &amp; 11 &amp; 1 &amp; 1\end{array}\right]
\end{displaymath}
\fi

Riordan arrays $B^{[\mathfrak{p}]}$ can be completely defined by using the results of Theorem \ref{teo1} and the product rule of the Riordan group.
Doing so, for each pattern family studied in this work with $j&gt;1$,
the Riordan array $\mathcal{R}^{[\mathfrak{p}]}$  appears to be the binomial transform of another Riordan array $B^{[\mathfrak{p}]}$
 with non-negative integer coefficients, although
it is not easy to spot this property looking at the corresponding $h$ functions because their
series expansions might contain negative coefficients, as shown for matrices
$B^{[110]}$ and $B^{[11100]}$.  This fact could  be further investigated from an algebraic and combinatorial point of view and
possibly yield interesting combinatorial interpretations also in the
case $j&gt;1$.

\section{Acknowledgements}
We wish to thank  the editor-in-chief and the referee(s) for the thoughtful and helpful comments and suggestions.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\begin{thebibliography}{10}

\bibitem{Ardila}
F. Ardila.   Algebraic and geometric methods in enumerative combinatorics,
in  M. B\'{o}na, eds., {\em Handbook of Enumerative Combinatorics}, Chapman and Hall/CRC, 2015, pp.~3--172.

\bibitem{BMS07a}
D.~Baccherini, D.~Merlini, and R.~Sprugnoli, Binary words excluding a pattern
  and proper {R}iordan arrays, {\em Discrete Math.} {\bf 307} (2007),
  1021--1037.

\bibitem{BGP13}
S.~Bilotta, E.~Grazzini, and E.~Pergola, Counting binary words avoiding
  alternating patterns, {\em J. Integer Seq.} {\bf 16} (2013),
\href{https://cs.uwaterloo.ca/journals/JIS/VOL16/Grazzini/grazzini2.html}{Article 13.4.8}.

\bibitem{GO80}
L.~J. Guibas and M.~Odlyzko, Long repetitive patterns in random sequences, {\em
  Zeitschrift f\"{u}r Wahrscheinlichkeitstheorie} {\bf 53} (1980), 241--262.

\bibitem{GO81}
L.~J. Guibas and M.~Odlyzko, String overlaps, pattern matching, and
  nontransitive games, {\em J. Combin. Theory Ser. A} {\bf 30}
  (1981), 183--208.

\bibitem{OEIS}
OEIS~Foundation Inc., The {O}n-line {E}ncyclopedia of {I}nteger {S}equences,
  \url{https://oeis.org/}.

\bibitem{LMMS14}
A.~Luz\'on, D.~Merlini, M.~A. Mor\'on, and R.~Sprugnoli, Complementary {R}iordan
  arrays, {\em Discrete Appl. Math.} {\bf 172} (2014), 75--87.

\bibitem{MRSV97}
D.~Merlini, D.~G. Rogers, R.~Sprugnoli, and M.~C. Verri, On some alternative
  characterizations of {R}iordan arrays, {\em Canad. J. Math.}
  {\bf 49} (1997), 301--320.

\bibitem{MS11}
D.~Merlini and R.~Sprugnoli, {Algebraic aspects of some Riordan arrays related
  to binary words avoiding a pattern}, {\em Theoret. Comput. Sci.} {\bf
  412} (2011), 2988--3001.

\bibitem{MSV09}
D.~Merlini, R.~Sprugnoli, and M.~C. Verri, Combinatorial sums and implicit
  {R}iordan arrays, {\em Discrete Math.} {\bf 309} (2009), 475--486.

\bibitem{SF96}
R.~Sedgewick and P.~Flajolet, {\em An {I}ntroduction to the {A}nalysis of
  {A}lgorithms}, Addison-Wesley, Reading, MA, 1996.

\bibitem{SGWW91}
L.~W. Shapiro, S.~Getu, W.-J. Woan, and L.~Woodson, The {R}iordan group, {\em
  Discrete Appl. Math.} {\bf 34} (1991), 229--239.

\bibitem{Spr94}
R.~Sprugnoli, Riordan arrays and combinatorial sums, {\em Discrete Math.}
  {\bf 132} (1994), 267--290.

\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}: Primary  05A05; Secondary 05A15, 05A19.

\noindent {\it Keywords}:  Riordan array, language avoiding pattern, generating function.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences 
\seqnum{A000225},
\seqnum{A001477},
\seqnum{A001700},
\seqnum{A001792},
\seqnum{A008619},
\seqnum{A025566},
\seqnum{A027306},
\seqnum{A052551},
\seqnum{A064189},
\seqnum{A079284},
\seqnum{A225034}, and
\seqnum{A261058}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received January 20 2017;
revised versions received   January 24 2017;
September 22 2017; November 7 2017; December 22 2017.
Published in {\it Journal of Integer Sequences}, January 21 2018.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{http://www.cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}

                                                                                


</pre></body></html>