\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\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}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

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

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

\usepackage{amscd}
\usepackage{lscape}
\usepackage{tikz}
\usepackage{tikz-cd}
\usepackage{pgfplots}

\usetikzlibrary{matrix}
\usetikzlibrary{fit,shapes}
\usetikzlibrary{positioning, calc}
\tikzset{circle node/.style = {circle,inner sep=1pt,draw, fill=white},
        X node/.style = {fill=white, inner sep=1pt},
        dot node/.style = {circle, draw, inner sep=5pt}
        }
\usepackage{tkz-fct}


\DeclareMathOperator{\Rev}{Rev}

\newcommand{\myboxedtext}[2][rectangle,draw,fill=white,rounded corners]{%
        \tikz[baseline=-0.6ex] \node [#1,rounded corners]{#2};}%

\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 On Motzkin-Schr\"oder Paths, 
\vskip .1in
Riordan Arrays, and Somos-$4$ Sequences} \vskip 1cm \large
Paul Barry\\
School of Science\\
South East Technological University\\
Ireland\\
\href{mailto:pbarry@wit.ie}{\tt pbarry@wit.ie}
\end{center}
\vskip .2 in

\begin{abstract} Building on work by Yang and Gao, we explore links between the enumeration of lattice paths with steps $(1,1)$, $(1,-1)$, $(1,0)$ and $(2,0)$, Riordan arrays, continued fractions and a conjectured link to Somos-$4$ sequences. The study gives insights into the Pascal rhombus and its Riordan array generalizations. We rely on the $A$-matrix definition of Riordan arrays first defined by Merlini, Rogers, Sprugnoli, and Verri for many of our results.
\end{abstract}

\section{Introduction}
By a \emph{Motzkin-Schr\"oder} path we shall understand a lattice path,
going from $(0,0)$ to $(n,0)$ using four types of step, $U=(1,1)$,
$D=(1,-1)$, $h=(1,0)$ and $H=(2,0)$, that does not go below the axis
$y=0$ (see Figure \ref{MS}). Such paths have been called $2$-Motzkin
paths, but this term has been also used to describe Motzkin paths with
two types of horizontal $h$ steps \cite{Chen, Deutsch}. These paths
have also been called $2$-generalized Motzkin paths \cite{Ramirez}. To
avoid confusion, we use the term Motzkin-Schr\"oder path in this note. A
Motzkin-Schr\"oder path with no $H$-steps is an ordinary Motzkin path,
while a Motzkin-Schr\"oder path of length $2n$ with no $h$-steps is an
ordinary Schr\"oder path. Lattice paths in the positive quadrant from
$(0,0)$ to $(n,0)$ with only the steps $(1,1)$ and $(1,-1)$ are called
\emph{Dyck paths} of length $n$.

Known sequences will be referred to by their 
{\it On-Line Encyclopedia of Integer Sequences} (OEIS) numbers \cite{SL1, SL2}. All number triangles in this note are of infinite extent; we show suitable truncations in relevant cases.

Dyck paths of length $n$ are enumerated by the Catalan numbers $C_n=\frac{1}{n+1}\binom{2n}{n}$ \seqnum{A000108}, governed by the recurrence
$$C_n = \sum_{i=0}^{n-1} C_i C_{n-i-1},\quad C_0=1.$$

Motzkin paths of length $n$ are enumerated by the Motzkin numbers $M_n=\sum_{k=0}^{\lfloor \frac{n}{2} \rfloor} \binom{n}{2k}C_k$ \seqnum{A001006}, governed by the recurrence
$$M_n=M_{n-1}+\sum_{i=0}^{n-2} M_i M_{n-2-i},\quad M_0=1, M_1=1.$$

Schr\"oder paths of length $2n$ are enumerated by the large Schr\"oder numbers $S_n=\sum_{k=0}^n \binom{n+k}{2k}C_k$ \seqnum{A06318}, governed by the recurrence
$$S_n=3 S_{n-1}+ \sum_{i=1}^{n-2} S_i S_{n-i-1},\quad S_0=1, S_1=2.$$

\begin{proposition} The number $A_n=A_n(r,s,t)$ of Motzkin-Schr\"oder paths of length $n$ where the horizontal steps $h$ can be of $r$ colors, the horizontal steps $H$ can be of $s$ colors and the up steps $(1,1)$ can be of $t$ colours is given by the following recurrence
\begin{equation}\label{Rec}A_n=r A_{n-1}+s A_{n-2}+t \sum_{i=0}^{n-2} A_i A_{n-2-i}, \quad A_0=1, A_1=r.\end{equation}
\end{proposition}
\begin{proof} The first term on the right covers the case where the path, which ends at $(n,0)$, has a final $h$ step. The second term covers the case where the path ends with a final $H$ step. This leaves the case where the path ends with a final down $(1,-1)$ step. Thus at some stage there was an up-step from the line $y=0$, which accounts for the multiplier $t$, and this up step factors the part of the path from level $1$ up into two paths of length $i$ and $n-2-i$.
\end{proof}
We have for instance, the following instances of $A_n(r,s,t)$ (where ``aerated'' signifies a sequence whose odd-indexed terms are $0$. Such a sequence will have a generating function with only even powers of $x$).
\begin{center}
\begin{tabular} {|c|c|c|}
\hline
$A_n(r,s,t)$ & sequence & OEIS \\\hline
$A_n(1,1,1)$ & $1,1,3,6,16,40,\ldots$ & \seqnum{A128720} \\\hline
$A_n(1,0,0)$ & $1,1,1,1,1,1,\ldots$ & \seqnum{A000012} \\\hline
$A_n(0,1,0)$ & $1,0,1,0,1,0,\ldots$ & \seqnum{A059841} \\\hline
$A_n(0,0,1)$ & $1,0,1,0,2,0,\ldots$ & \seqnum{A000108} aerated \\\hline
$A_n(1,1,0)$ & $1,1,2,3,5,8,\ldots$ & \seqnum{A000045} \\ \hline
$A_n(1,0,1)$ & $1,1,2,4,9,21,\ldots$ & \seqnum{A001006} \\ \hline
$A_n(0,1,1)$ & $1,0,2,0,6,0,\ldots$ & \seqnum{A006318} aerated \\ \hline
$A_n(1,0,2)$ & $1,1,3,7,21,61,\ldots$ & \seqnum{A025235} \\ \hline
$A_n(0,1,2)$ & $1,0,3,0,15,0,\ldots$ & \seqnum{A103210} aerated \\ \hline
$A_n(1,1,2)$ & $1,1,4,9,31,92, \ldots$ & $---$ \\ \hline
\end{tabular}
\end{center}

\begin{center}
\begin{figure} \label{MS}
\begin{center}
\begin{tikzpicture}[scale=0.6]

\draw (0.1,0)--(.9,0);
\draw (1.1,0)--(1.9,0);
\draw (2.1,0)--(2.9,0);

\draw (4.1,0)--(4.9,0);
\draw (5.0,0)--(7.0,0);

\draw (8.0,0)--(10.0,0);
\draw (10.1,0)--(10.9,0);

\draw (12.1,0)--(12.9,0);
\draw (13,0)--(14,1);
\draw (14,1)--(15,0);

\draw (16,0)--(17,1);
\draw (17,1)--(18,0);
\draw (18.1,0)--(18.9,0);

\draw (20,0)--(21,1);
\draw (21.1,1)--(21.9,1);
\draw (22,1)--(23,0);

\draw (0.1,3)--(0.9,3);
\draw (1.1,3)--(1.9,3);

\draw (3,3)--(5,3);
\draw (6,3)--(7,4)--(8,3);

\draw (0.1,6)--(0.9,6);

\draw[thick] (0, 8)--(0.2,8);

\end{tikzpicture}
\end{center}
\caption{Motzkin-Schr\"oder paths for $n=0,1,2,3$}
\end{figure}
\end{center}

\section{Generating functions, continued fractions and Riordan arrays}
By translating the recurrence (\ref{Rec}) into an equation for the generating function, we obtain the following proposition.
\begin{proposition} Let $g(x)=g(x;r,s,t)=\sum_{n=0}^{\infty} A_n(r,s,t) x^n$. Then we have
\begin{itemize}
\item $g(x)=\frac{1}{1-rx-sx^2} c\left(\frac{tx^2}{(1-rx-sx^2)^2}\right)$, where $c(x)=\frac{1-\sqrt{1-4x}}{2x}$ is the generating function of the Catalan numbers,
\item $g(x)=\frac{1}{1-(r-\sqrt{t})x-sx^2} m \left(\frac{\sqrt{t}x}{1-(r-\sqrt{t})x-sx^2}\right)$, where $m(x)$ is the generating function of the Motzkin numbers.
\end{itemize}
\end{proposition}
Before proving this result, we recall some results about Riordan arrays \cite{book1, book2, SGWW}. A Riordan array can be defined by a pair of power series $g(x), f(x)$ where
$$g(x)=g_0+g_1x+g_2x^2+\cdots,$$ where $g_0 \ne 0$,  and
$$f(x)= f_1 x+ f_2x^2+f_3 x^3+\cdots,$$
where $f_0=0$ and $f_1 \ne 0$. Such pairs $(g(x), f(x))$ then constitute a group for the product
$$ (g(x), f(x))\cdot (u(x), v(x)) = (g(x) u(f(x)), v(f(x))).$$
The pair $(g(x), f(x))$ acts on a power series $h(x)$ by weighted composition as follows.
$$ (g(x), f(x))\cdot h(x)= g(x) h(f(x)).$$
This operation is generally referred to as the fundamental theorem of Riordan arrays. The pair of power series $(g(x), f(x))$ has a matrix representation given by the matrix $(t_{n,k})_{0 \le i,j \le \infty}$ where
$$t_{n,k}=[x^n] g(x)f(x)^k.$$ Here, $[x^n]$ is the linear functional that extracts the coefficient of $x^n$ in the power series. The matrix $(t_{n,k})$ is then the Riordan array representing the Riordan group element $(g(x), f(x))$. By an abuse of language, we often refer to the pair $(g(x), f(x))$ as a Riordan array. By construction, Riordan arrays are invertible lower-triangular matrices, and the group product above translates into matrix multiplication in the matrix representation.

Riordan arrays have several sequence characterizations. For instance, $(t_{n,k})$ is a Riordan array if and only if we can express $t_{n+1,k+1}$ as a (fixed) linear combination of the elements in the row above it and starting with $t_{n,k}$. The coefficients of this linear combination constitute what is referred to as the $A$ sequence of the array. An alternative $A$ matrix characterization exists, and we shall see some examples of this later in this note.
\begin{proof} The generating function $g(x)$ satisfies the equation
$$g(x)=1+ r x g(x)+s x^2 g(x)+ t x^2 g(x)^2.$$
Solving this equation for $g(x)$, we find that
$$g(x)=\frac{1-rx-sx^2-\sqrt{(1-rx-sx^2)^2-4tx^2}}{2tx^2}.$$
With $c(x)=\frac{1-\sqrt{1-4x}}{2x}$, this last expression is then equal to
$$\frac{1}{1-rx-sx^2} c\left(\frac{tx^2}{(1-rx-sx^2)^2}\right).$$
Similarly, with
$$m(x)=\frac{1-x-\sqrt{1-2x-3x^2}}{2x^2}$$ we can verify that
$$g(x)=\frac{1}{1-(r-\sqrt{t})x-sx^2} m \left(\frac{\sqrt{t}x}{1-(r-\sqrt{t})x-sx^2}\right).$$
\end{proof}
\begin{corollary}
The generating function $g(x;r,s,t)$ is the result of operating on the generating function of the Motzkin numbers $m(x)$ by the Riordan array
$$\left(\frac{1}{1-(r-\sqrt{t})x-sx^2}, \frac{\sqrt{t}x}{1-(r-\sqrt{t})x-sx^2}\right).$$
\end{corollary}
\begin{proof} This follows from the proposition and the fundamental theorem of Riordan arrays \cite{SGWW}, which takes the form $(u(x), v(x))\cdot g(x)= u(x) g(v(x))$.
\end{proof}
\begin{corollary} The generating function $g(x;r,s,t)$ is the result of operating on the generating function of the Catalan numbers $c(x)$ by the stretched Riordan array
$$\left(\frac{1}{1-rx-sx^2}, \frac{tx^2}{(1-rx-sx^2)^2}\right).$$
\end{corollary}
\begin{corollary}
We have
$$A_n(r,s,t)=\sum_{k=0}^n \sum_{j=0}^{n-2k} \binom{2k+j}{j}\binom{j}{n-2k-j} s^{n-2k-j}r^{2(k+j)-n} t^k C_k.$$
\end{corollary}
The generating function $c(x)$ of the Catalan numbers can be expressed as the following Stieltjes-type continued fraction \cite{Wall}.
$$c(x)=\cfrac{1}{1-\cfrac{x}{1-\cfrac{x}{1-\cdots}}}.$$
Operating on this by the stretched Riordan array $\left(\frac{1}{1-rx-sx^2}, \frac{tx^2}{(1-rx-sx^2)^2}\right)$ and simplifying, gives us the following result.
\begin{proposition} We let $g(x;r,s,t)$ be the generating function of generalized Motzkin-Schr\"oder lattice paths where the $h$ steps have $r$ colors, the $H$ steps have $s$ colors and the up steps have $t$ colors. Then we have $$g(x)=\cfrac{1}{1-rx-sx^2-\cfrac{tx^2}{1-rx-sx^2-\cfrac{tx^2}{1-rx-\cdots}}}.$$
\end{proposition}
\begin{proof} Solving the equation
$$u=\frac{1}{1-rx-sx^2-tx^2u}$$ gives $u(x)=g(x)$.
\end{proof}
\section{Number triangles}
We express
\begin{align*}g(x;r,s,t)&=\frac{1-rx-sx^2-\sqrt{1-2rx+(r^2-2s-4t)x^2+2rsx^3+s^2x^4}}{2tx^2}\\
&=\frac{1-rx-sx^2-\sqrt{(1-rx-sx^2)^2-4tx^2}}{2tx^2}\end{align*} as
$$g(x;r,s,t)=\sum_{n=0}^{\infty} \sum_{k=0}^{\infty} T_{n,k}(s,t) r^k x^n.$$
Then the matrix $(T_{n,k}(s,t))$ begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
 s+t & 0 & 1 & 0 & 0 & 0 & 0 \\
 0 & 2 s+3 t & 0 & 1 & 0 & 0 & 0 \\
 (s+t) (s+2 t) & 0 & 3 (s+2 t) & 0 & 1 & 0 & 0 \\
 0 & 3 s^2+12 t s+10 t^2 & 0 & 2 (2 s+5 t) & 0 & 1 & 0 \\
 (s+t) \left(s^2+5 t s+5 t^2\right) & 0 & 6 \left(s^2+5 t s+5 t^2\right) & 0 & 5 (s+3 t) & 0 & 1 \\
\end{array}
\right).$$
For instance, when $s=t=1$, the row sums of this triangle (corresponding to $r=1$), give the numbers of Motzkin-Schr\"oder paths of length $n$ $1,1,3,6,16,40,\ldots$. Thus we have
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
 2 & 0 & 1 & 0 & 0 & 0 & 0 \\
 0 & 5 & 0 & 1 & 0 & 0 & 0 \\
 6 & 0 & 9 & 0 & 1 & 0 & 0 \\
 0 & 25 & 0 & 14 & 0 & 1 & 0 \\
 22 & 0 & 66 & 0 & 20 & 0 & 1 \\
\end{array}
\right)\cdot \left(\begin{array}{c}1\\1\\1\\1\\1\\1\\1\\ \end{array}\right)=
\left(\begin{array}{c}1\\1\\3\\6\\16\\40\\109\\ \end{array}\right).$$
This triangle is \seqnum{A132277}.

The first column of the matrix $(T_{n,k}(s,t))$ has its generating function given by $g(x;0,s,t)$, or
$$g(x;0,s,t)=\frac{1-sx^2-\sqrt{(1-sx^2)-4tx^2}}{2tx^2}.$$
This expands to give the aerated sequence
$$1, 0, s + t, 0, s^2 + 3st + 2t^2, 0, s^3 + 6s^2t + 10st^2 + 5t^3, 0, \ldots.$$
When $s=t=1$, this gives the aerated large Schr\"oder numbers $1,0,2,0,6,0,22,0,\ldots$.
We have the following related continued fraction.
\begin{proposition} The generating function $g(\sqrt{x};0,s,t)$ can be expressed as the following Thron-type continued fraction \cite{Thron}
$$g(\sqrt{x};0,s,t)=\cfrac{1}{1-s x - \cfrac{tx}{1-sx-\cfrac{tx}{1-sx - \cdots}}}.$$
\end{proposition}
\begin{proof}
Solving the equation $u=\frac{1}{1-sx-tx u}$ yields
$$u(x)=\frac{1-sx-\sqrt{1-2(s+2t)x+s^2x^2}}{2tx}=g(\sqrt{x};0,s,t).$$
\end{proof}
Thus $g(\sqrt{x};0,s,t)$ is the generating function of Schr\"oder paths whose level steps have $s$ colors and whose up steps have $t$ colors. The generating function $g(\sqrt{x};0,s,t)$ expands to give the sequence
that begins
$$1, s + t, s^2 + 3st + 2t^2, s^3 + 6s^2t + 10st^2 + 5t^3,\ldots.$$ In matrix terms, this gives us, for instance $$\left(
\begin{array}{ccccc}
 1 & 0 & 0 & 0 & 0 \\
 t & 1 & 0 & 0 & 0 \\
 2 t^2 & 3 t & 1 & 0 & 0 \\
 5 t^3 & 10 t^2 & 6 t & 1 & 0 \\
 14 t^4 & 35 t^3 & 30 t^2 & 10 t & 1 \\
\end{array}
\right)\left(\begin{array}{c}1\\s\\s^2\\s^3\\s^4\\ \end{array}\right)=
\left(\begin{array}{c}1\\s+t\\s^2 + 3st + 2t^2\\s^3 + 6s^2t + 10st^2 + 5t^3\\\cdots\\ \end{array}\right).$$
The matrix that begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 & 0 \\
 2 & 3 & 1 & 0 & 0 & 0 & 0 \\
 5 & 10 & 6 & 1 & 0 & 0 & 0 \\
 14 & 35 & 30 & 10 & 1 & 0 & 0 \\
 42 & 126 & 140 & 70 & 15 & 1 & 0 \\
 132 & 462 & 630 & 420 & 140 & 21 & 1 \\
\end{array}
\right)$$ is \seqnum{A060693}, whose $(n,k)$-th element counts the number of Schr\"oder paths from $(0,0)$ to $(2n,0)$ having $k$ peaks.

\section{Hankel transform}
The Hankel transform $h_n(r,s,t)$ of $A_n(r,s,t)$, given by $h_n=|A_{i+j}(r,s,t)|_{0\le i,j \le n}$, begins
$$1, s + t,r^2st + t(s + t)^2, t^2(r^4st + (s + t)^4), t^4(r^6st^2 + r^4s(s^3 - 3st^2 - 2t^3) + 3r^2s(s + t)^4 + (s + t)^6),\ldots.$$
We have the following conjecture \cite{GenCat}.
\begin{conjecture} Let $A_n(r,s,t)$ be the sequence giving the number of Motzkin-Schr\"oder paths whose $h$ steps have $r$ colors, whose $H$ steps have $s$ colors, and whose up steps have $t$ colors. Then the Hankel transform $h_n(r,s,t)$ of $A_n(r,s,t)$ is a $((rt)^2, t^2((s+t)^2-r^2t))$ Somos-$4$ sequence.
\end{conjecture}
Here, by an $(\alpha,\beta)$ Somos-$4$ sequence we mean a sequence $s_n$ \cite{Hone} such that
$$ \alpha s_{n-1} s_{n-3} + \beta s_{n-4}^2 = s_n s_{n-4}.$$
\begin{example} The sequence $A_n(1,1,1)$ is the sequence $1,1,3,6,16,40,\ldots$ that counts Motzkin-Schr\"oder paths, \seqnum{A128720}.  Its Hankel transform $h_n(1,1,1)$ is given by \seqnum{A174168}. This sequence begins
$$1, 2, 5, 17, 109, 706, 9529, 149057, 3464585, \ldots.$$ It is a $(1,3)$ Somos-$4$ sequence.
\end{example}
\section{The Pascal rhombus and the $A$-matrix}
In this section we let $g(x)=g(x;1,1,1)$. Thus
$$g(x)=\frac{1-x-x^2-\sqrt{1-2x-5x^2+2x^3+x^4}}{2x^2}=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2}}{2x^2}.$$
The Riordan array $(R_{n,k})$ of Bell type given by $(g(x), xg(x))$ begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 2 & 1 & 0 & 0 & 0 \\
 6 & 7 & 3 & 1 & 0 & 0 \\
 16 & 18 & 12 & 4 & 1 & 0 \\
 40 & 53 & 37 & 18 & 5 & 1 \\
\end{array}
\right).$$
This is \seqnum{A132276}. This Riordan array is known in the literature as the \emph{left-bounded Pascal rhombus} \cite{Klostermeyer, Ramirez, Yang}. The rhombus appellation comes from the following property.
$$
R_{n,k}=\begin{cases}
 0,  & \text{if $k<0$;}\\
 0^k, & \text{if $n=0$;}\\
 \binom{1}{k}, &\text{if $n=1$;}\\
 R_{n-1,k-1}+R_{n-1,k}+R_{n-1,k+1}+R_{n-2,k}, & \text{otherwise.}
 \end{cases}
$$
Thus this is a Riordan array with $A$-matrix \cite{He, Alt} given by
$$\left(
\begin{array}{ccc}
 0 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right).$$
The row sums of this matrix, which begin
$$1, 2, 6, 17, 51, 154, 473, 1464,\ldots$$ are given by \seqnum{A059398}, which counts the left factors of Motzkin-Schr\"oder paths (or equivalently, the number of symmetric Motzkin-Schr\"oder paths of length $2n$). The generating function of the row sums of a Bell matrix $(g(x), x g(x))$ is the INVERT transform $\frac{g(x)}{1-xg(x)}$ of $g(x)$. We deduce that the generating function of \seqnum{A059398} can be expressed as the generating function
$$\cfrac{1}{1-2x-x^2-\cfrac{x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}.$$
In fact, we have the following proposition.
\begin{proposition} The generating function $\frac{g(x)}{1-xyg(x)}$ of the left-bounded Pascal rhombus can be expressed as the following continued fraction.
$$G(x,y)=\cfrac{1}{1-(y+1)x-x^2-\cfrac{x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}.$$
\end{proposition}
\begin{proof} We have that $$G(x,y)=\frac{1}{1-(y+1)x-x^2-x^2 g(x)}.$$
Simplifying the right hand side shows that $G(x,y)=\frac{g(x)}{1-xyg(x)}$.
\end{proof}
We note that the generating function given by the continued fraction
$$\cfrac{1}{1-x-(y+1)x^2-\cfrac{x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}$$ is the generating function of the stretched Riordan array $(g(x), x^2g(x))$ which begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 3 & 1 & 0 & 0 & 0 & 0 & 0 \\
 6 & 2 & 0 & 0 & 0 & 0 & 0 \\
 16 & 7 & 1 & 0 & 0 & 0 & 0 \\
 40 & 18 & 3 & 0 & 0 & 0 & 0 \\
 109 & 53 & 12 & 1 & 0 & 0 & 0 \\
\end{array}
\right).$$
The row sums
 $$1, 1, 4, 8, 24, 61, 175, 486, 1405, 4059,\ldots$$ of this matrix are thus the diagonal sums of the left-bounded Pascal rhombus. This sequence is \seqnum{A190156}. It thus has generating function given by
$$\cfrac{1}{1-x-2x^2-\cfrac{x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}.$$
\begin{proposition} The generating function
$$\cfrac{1}{1-x-x^2-\cfrac{(y+1)x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}$$ is that of the triangle with general term $T_{n,2k}$ where $(T_{n,k})$ is the left-bounded Pascal rhombus $(g(x), xg(x))$. The row sums of this matrix have generating function
$$\cfrac{1}{1-x-x^2-\cfrac{2x^2}{1-x-x^2-\cfrac{x^2}{1-x-x^2-\cdots}}}.$$ The array $(T_{n,2k})$ begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 3 & 1 & 0 & 0 & 0 & 0 & 0 \\
 6 & 3 & 0 & 0 & 0 & 0 & 0 \\
 16 & 12 & 1 & 0 & 0 & 0 & 0 \\
 40 & 37 & 5 & 0 & 0 & 0 & 0 \\
 109 & 120 & 25 & 1 & 0 & 0 & 0 \\
\end{array}
\right).$$ The row sums
$$1, 1, 4, 9, 29, 82, 255, 773, 2410, 7499,\ldots$$ are the main diagonal of the Pascal rhombus \seqnum{A059317}.
\end{proposition}
This row sums sequence is then given by \seqnum{A059345}. We recall that the (left-justified) Pascal rhombus begins
$$\left(
\begin{array}{ccccccccccccc}
 \mathbf{1} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & \mathbf{1} & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 2 & \mathbf{4} & 2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 3 & 8 & \mathbf{9} & 8 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 4 & 13 & 22 & \mathbf{29} & 22 & 13 & 4 & 1 & 0 & 0 & 0 & 0 \\
 1 & 5 & 19 & 42 & 72 & \mathbf{82} & 72 & 42 & 19 & 5 & 1 & 0 & 0 \\
 1 & 6 & 26 & 70 & 146 & 218 & \mathbf{255} & 218 & 146 & 70 & 26 & 6 & 1 \\
\end{array}
\right),$$ where we have high-lighted the main diagonal elements. The generating function of the Pascal rhombus $(R_{n,k})$ is $\frac{1}{1-x-xy-xy^2-x^2y^2}$.
We briefly examine the bisection $R_{n,2k}$ of the Pascal rhombus, which begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 4 & 1 & 0 & 0 & 0 & 0 \\
 1 & 8 & 8 & 1 & 0 & 0 & 0 \\
 1 & 13 & 29 & 13 & 1 & 0 & 0 \\
 1 & 19 & 72 & 72 & 19 & 1 & 0 \\
 1 & 26 & 146 & 255 & 146 & 26 & 1 \\
\end{array}
\right).$$
\begin{conjecture} The generating function of the bisection $(R_{n,2k})$ of the Pascal rhombus is given by
$$\frac{1-(y+1)x+yx^2}{1-2(y+1)x+(1-y+y^2)x^2+2y(y+1)x^3+y^2x^4}.$$
\end{conjecture}
Based on this conjecture, we can further posit that the row sums of this triangle, which begin
$$1, 2, 6, 18, 57, 184, 601, 1974, 6502, 21446, \ldots,$$ have generating function
$$\frac{1-2x-x^2}{1-4x+x^2+4x^3+x^4},$$ and the diagonal sums, which begin
$$1, 1, 2, 5, 10, 22, 50, 112, 254, 579, \ldots,$$ have generating function
$$\frac{1-x-x^2-x^3}{(1+x+x^2)(1-3x+x^2+x^3+x^4)}.$$
\begin{example}
We consider the number triangle $(\tilde{R}_{n,k})$ defined as follows.
$$
\tilde{R}_{n,k}=\begin{cases}
 0, & \text{if $k<0$;}\\
 0^k, & \text{if $n=0$;}\\
 \binom{1}{k}+\binom{0}{k}, & \text{if $n=1$;}\\
 \tilde{R}_{n-1,k-1}+2 \tilde{R}_{n-1,k}+\tilde{R}_{n-1,k+1}+\tilde{R}_{n-2,k}, & \text{otherwise.}
 \end{cases}
$$
This array begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 2 & 1 & 0 & 0 & 0 & 0 & 0 \\
 6 & 4 & 1 & 0 & 0 & 0 & 0 \\
 18 & 16 & 6 & 1 & 0 & 0 & 0 \\
 58 & 60 & 30 & 8 & 1 & 0 & 0 \\
 194 & 224 & 134 & 48 & 10 & 1 & 0 \\
 670 & 836 & 570 & 248 & 70 & 12 & 1 \\
\end{array}
\right).$$
The first column sequence $\tilde{R}_{n,0}$
$$1,2,6,18,58,194,\ldots$$
counts Motzkin-Schr\"oder paths with two kinds of $h$ steps. It is essentially \seqnum{A085139}. We deduce that
$$\tilde{R}_{n,0}=\sum_{k=0}^{n+1} \binom{\frac{n+k-1}{2}}{ \frac{n-k+1}{2}}\frac{1-(-1)^{n-k}}{2} C_k.$$
The Hankel transform of the sequence $\tilde{R}_{n,0}$ is the sequence $2^{\lfloor \frac{(n+1)^2}{3} \rfloor}$ that begins
$$	1, 2, 8, 32, 256, 4096, 65536,\ldots.$$
This sequence satisfies the (simplified) Somos-$4$ relation
$$s_n =\frac{4 s_{n-1} s_{n-3}}{s_{n-4}}.$$
\end{example}
\begin{example}
We consider the number triangle $(\bar{R}_{n,k})$ defined as follows.
$$
\bar{R}_{n,k}=\begin{cases}
 0, & \text{if $k<0$;}\\
 0^k, & \text{if $n=0$;}\\
 \binom{1}{k}+2\binom{0}{k}, & \text{if $n=1$;}\\
 \bar{R}_{n-1,k-1}+3 \bar{R}_{n-1,k}+\bar{R}_{n-1,k+1}+\bar{R}_{n-2,k}, & \text{otherwise.}
 \end{cases}
$$
The matrix $(\bar{R}_{n,k})$ begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 3 & 1 & 0 & 0 & 0 & 0 & 0 \\
 11 & 6 & 1 & 0 & 0 & 0 & 0 \\
 42 & 31 & 9 & 1 & 0 & 0 & 0 \\
 168 & 150 & 60 & 12 & 1 & 0 & 0 \\
 696 & 709 & 351 & 98 & 15 & 1 & 0 \\
 2965 & 3324 & 1920 & 672 & 145 & 18 & 1 \\
\end{array}
\right).$$
The first column sequence $\bar{R}_{n,0}$ (essentially \seqnum{A084782}), counts Motzkin-Schr\"oder paths with three types of $h$ step. The generating function of the sequence $\bar{R}_{n,0}$ can be expressed as
$$ \frac{c\left(\frac{x}{1-x-x^2}\right)-1}{x}.$$
The Hankel transform of this sequence begins
$$1, 2, 13, 97, 901, 29186, 1647721, 93837697, \ldots.$$
By our conjecture this is a $(9,-5)$ Somos-$4$ sequence (\seqnum{A184019}).

Note that the matrix $\bar{R}$ is a Bell-type Riordan array with $A$-matrix
$$\left(
\begin{array}{ccc}
 0 & 3 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right).$$
\end{example}

We finish this section by noting that the matrix product $(R_{n,k})\cdot \left((-1)^{n-k}\binom{n}{k}\right)$ begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
 2 & 0 & 1 & 0 & 0 & 0 & 0 \\
 1 & 4 & 0 & 1 & 0 & 0 & 0 \\
 7 & 2 & 6 & 0 & 1 & 0 & 0 \\
 10 & 18 & 3 & 8 & 0 & 1 & 0 \\
 37 & 24 & 33 & 4 & 10 & 0 & 1 \\
\end{array}
\right).$$
It is a Riordan array whose row sums enumerate the Motzkin-Schr\"oder paths. The triangle itself enumerates  Motzkin-Schr\"oder paths of length $n$ according to the number of $h$ steps at level $0$.
\section{The $A$-matrix and continued fractions}
The governing result concerning the $A$-matrix approach to Riordan arrays is as follows \cite{He, Alt}.
\begin{theorem} A lower-triangular array $(t_{n,k})_{0 \le n,k \le \infty}$ is a Riordan array if and only if there exists another array $A=(a_{i,j})_{i,j \in \mathbb{N}_0}$ with $a_{0,0} \ne 0$, and a sequence $(\rho_j)_{j \in \mathbb{N}_0}$ such that
$$t_{n+1,k+1}=\sum_{i \ge 0} \sum_{j \ge 0} a_{i,j} t_{n-i, k+j} + \sum_{j \ge 0} \rho_j t_{n+1,k+j+2}.$$
\end{theorem}
The power series definition of a Riordan array is as follows. A Riordan array is defined by a pair of power series, $g(x)$ and $f(x)$, where
$$g(x)=g_0 + g_1 x + g_2 x^2+ \cdots, \quad g_0 \ne 0,$$ and
$$f(x)=f_1 x + f_2 x^2+ f_3 x^3+\cdots, \quad f_0=0 \text{ and } f_1 \ne 0.$$
We then have
$$t_{n,k}=[x^n] g(x)f(x)^k,$$ where $[x^n]$ is the functional that extracts the coefficient of $x^n$.
The relationship between $f(x)$ and the pair $(A, \rho)$ is given by the following key equation.
$$\frac{f(x)}{x}=\sum_{i \ge 0} x^i R^{(i)}(f(x))+\frac{f(x)^2}{x}\rho(f(x)),$$ where
$R^{(i)}$ is the generating series of the $i$-th row of $A$, and $\rho(x)$ is the generating series of the sequence $\rho_n$.

We consider the case
$$A=\left(
\begin{array}{ccc}
 1 & b & d \\
 1 & a & c \\
\end{array}
\right),$$ with $\rho_n=0$ for all $n$.
To find $u=f(x)$, we solve the equation
$$\frac{u}{x}=1+ bu + du^2+ x(1+au+ cu^2).$$
We obtain
$$u(x)=\frac{1-ax-bx^2-\sqrt{(1-ax-bx^2)^2-4x^2(1+x)(d+cx)}}{2x(d+cx)}.$$
We can express this as
$$\frac{u(x)}{x}=\frac{(1+x)}{1-ax-bx^2}ct\left(\frac{x^2(1+x)(d+cx)}{(1-ax-bx^2)^2}\right).$$
Thus we can express this as the following continued fraction.
$$\frac{u(x)}{x}=\cfrac{1}{1-ax-bx^2-\cfrac{x^2(1+x)(d+cx)}{1-ax-bx^2-\cfrac{x^2(1+x)(d+cx)}{1-ax-bx^2-\cdots}}}.$$
We now look at the $8$ cases defined by the $A$-matrix $\left(
\begin{array}{ccc}
 a & b & c \\
 1 & 1 & 1 \\
\end{array}
\right)$ for $a,b,c \in \{0,1\}$.
\begin{itemize}
\item The case $\left(
\begin{array}{ccc}
 0 & 0 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$. This gives us the equation
$$\frac{u}{x}=1+u+u^2,$$ with solution
$$f(x)=u(x)=\frac{1-x-\sqrt{1-2x-3x^2}}{2x}=\frac{1-x-\sqrt{(1-x)^2-4x^2}}{2x}=x m(x).$$
The corresponding equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}$$ gives us the Bell Riordan array $(m(x),xm(x))$ that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 2 & 2 & 1 & 0 & 0 & 0 \\
 4 & 5 & 3 & 1 & 0 & 0 \\
 9 & 12 & 9 & 4 & 1 & 0 \\
 21 & 30 & 25 & 14 & 5 & 1 \\
\end{array}
\right).$$ The generating function $m(x)$ is that of the Motzkin numbers \seqnum{A001006} and the Riordan array is \seqnum{A064189}.
\item The case  $\left(
\begin{array}{ccc}
 0 & 0 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$.
We obtain
$$f(x)=u(x)=\frac{1-x-\sqrt{1-2x-3x^2-4x^3}}{2x(1+x)}=\frac{1-x-\sqrt{(1-x)^2-4x^2(1+x)}}{2x(1+x)}.$$
This case corresponds to lattice paths with steps $(1,1), (1,-1), (1,0)$ and a second up step $(2,1)$. The generating function $g(x)=\frac{f(x)}{x}$ is that of the so-called horse permutations \cite{horse}. The equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k+1}$$ yields the Bell-type Riordan array that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 2 & 2 & 1 & 0 & 0 & 0 \\
 5 & 5 & 3 & 1 & 0 & 0 \\
 12 & 14 & 9 & 4 & 1 & 0 \\
 31 & 38 & 28 & 14 & 5 & 1 \\
\end{array}
\right).$$ The generating function $g(x)$ expands to give the sequence \seqnum{A071359} which begins
$$1,1,2,5,12,31,83\ldots.$$ The Riordan array is \seqnum{A190252}. The matrix given by
$(g(x), xg(x)) \cdot \left(\frac{1}{1+x}, \frac{x}{1+x}\right)$ where the second array is the inverse binomial array $\left((-1)^{n-k}\binom{n}{k}\right)$ begins
$$\left(
\begin{array}{ccccccc}
 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 0 & 1 & 0 & 0 & 0 & 0 \\
 2 & 2 & 0 & 1 & 0 & 0 & 0 \\
 4 & 4 & 3 & 0 & 1 & 0 & 0 \\
 11 & 9 & 6 & 4 & 0 & 1 & 0 \\
 28 & 26 & 15 & 8 & 5 & 0 & 1 \\
\end{array}
\right).$$
This counts such ``horse'' paths \cite{ horse, Alt} (see Figure \ref{Horse_figure}) in terms of the number of flat steps at level $0$. These paths are governed by the following recurrence
\begin{equation}\label{horse}H_n=H_{n-1}+ \sum_{i=0}^{n-2} H_i H_{n-2-i}+ \sum_{i=0}^{n-3} H_i H_{n-3-i}, \quad H_0=1, H_1=1, H_2=2.\end{equation}
Equivalently, we have the following equation for the generating function $g_h(x)$.
$$g_h(x)=1+xg_h(x)+x^2g_h(x)^2+x^3g_h(x)^2.$$

\begin{center}
\begin{figure}

\begin{center}
\begin{tikzpicture}[scale=0.6]

\draw (0.1,0)--(.9,0);
\draw (1.1,0)--(1.9,0);
\draw (2.1,0)--(2.9,0);

\draw (4.1,0)--(4.9,0);
\draw (5,0)--(6,1);
\draw (6,1)--(7,0);

\draw (8,0)--(9,1);
\draw (9,1)--(10,0);
\draw (10.1,0)--(10.9,0);

\draw (12,0)--(13,1);
\draw (13.1,1)--(13.9,1);
\draw (14,1)--(15,0);

\draw (16,0)--(18,1);
\draw (18,1)--(19,0);

\draw (0.1,3)--(0.9,3);
\draw (1.1,3)--(1.9,3);

\draw (3,3)--(4,4)--(5,3);

\draw (0.1,6)--(0.9,6);

\draw[thick] (0, 8)--(0.2,8);

\end{tikzpicture}
\end{center}

\caption{``Horse'' paths for $n=0,1,2,3$}\label{Horse_figure}
\end{figure}
\end{center}

\item The case  $\left(
\begin{array}{ccc}
 0 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ is that of the Motzkin-Schr\"oder paths. Thus
\begin{align*}u(x)=f(x)&=\frac{1-x-x^2-\sqrt{1-2x-5x^2+3x^3+x^4}}{2x}\\&=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2}}{2x}.\end{align*}
Then the equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k}$$ yields the Bell-type Riordan array
$(g(x), xg(x))$ with $f(x)=xg(x)$ which begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 2 & 1 & 0 & 0 & 0 \\
 6 & 7 & 3 & 1 & 0 & 0 \\
 16 & 18 & 12 & 4 & 1 & 0 \\
 40 & 53 & 37 & 18 & 5 & 1 \\
\end{array}
\right).$$ This is \seqnum{A132276}.
\item
The case  $\left(
\begin{array}{ccc}
 0 & 1 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ gives us
\begin{align*}u(x)=f(x)&=\frac{1-x-x^2-\sqrt{1-2x-5x^2-2x^3+x^4}}{2x(1+x)}\\
&=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2(1+x)}}{2x(1+x)}.\end{align*}
The equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k}+T_{n-2,k+1}$$ yields the Bell-type Riordan array that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 2 & 1 & 0 & 0 & 0 \\
 7 & 7 & 3 & 1 & 0 & 0 \\
 19 & 20 & 12 & 4 & 1 & 0 \\
 53 & 61 & 40 & 18 & 5 & 1 \\
\end{array}
\right).$$ The sequence that begins
$$1,1,3,7,19,53,153,\ldots$$ is \seqnum{A078481}.
\item The case  $\left(
\begin{array}{ccc}
 1 & 0 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ gives us
$$u(x)=f(x)=\frac{1-x-\sqrt{1-2x-3x^2-4x^3}}{2x}.$$
The corresponding equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k}+T_{n-2,k-1}$$ leads to the Riordan array
$(g(x), (1+x)xg(x))$ where $f(x)=x(1+x)g(x)$. This array begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 2 & 3 & 1 & 0 & 0 & 0 \\
 5 & 7 & 5 & 1 & 0 & 0 \\
 12 & 19 & 16 & 7 & 1 & 0 \\
 31 & 52 & 49 & 29 & 9 & 1 \\
\end{array}
\right).$$
This is not of Bell-type. The sequence $1,1,2,5,12,\ldots$ is \seqnum{A071359}.
The generating function $f(x)/x$ expands to give the sequence that begins
$$1,2,3,7,17,43,\ldots.$$ This is \seqnum{A143013}.
\item
The case  $\left(
\begin{array}{ccc}
 1 & 0 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ gives us
$$u(x)=f(x)=\frac{1-x-\sqrt{1-2x-3x^2-8x^3-4x^4}}{2x(1+x)}=\frac{1-x-\sqrt{(1+x)^2-4x^2(1+x)^2}}{2x(1+x)}.$$
The corresponding equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k}+T_{n-2,k-1}$$ leads to the Riordan array $(g(x), (1+x)xg(x))$ (where $f(x)=x(1+x)g(x)$) that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 2 & 3 & 1 & 0 & 0 & 0 \\
 6 & 7 & 5 & 1 & 0 & 0 \\
 16 & 21 & 16 & 7 & 1 & 0 \\
 44 & 64 & 52 & 29 & 9 & 1 \\
\end{array}
\right).$$
This is not a Bell-type Riordan array.
\item
The case  $\left(
\begin{array}{ccc}
 1 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ gives us
\begin{align*}u(x)=f(x)&=\frac{1-x-x^2-\sqrt{1-2x-5x^2-2x^3+x^4}}{2x}\\
&=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2(1+x)}}{2x}.\end{align*}
The corresponding equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k}+T_{n-2,k}$$ leads to the Riordan array $(g(x), (1+x)xg(x))$ where $f(x)=x(1+x)g(x)$, that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 3 & 1 & 0 & 0 & 0 \\
 7 & 9 & 5 & 1 & 0 & 0 \\
 19 & 27 & 19 & 7 & 1 & 0 \\
 53 & 81 & 67 & 33 & 9 & 1 \\
\end{array}
\right).$$ The sequence $1,1,3,7,19,\ldots$ is \seqnum{A078481}. The generating function $f(x)/x$ expands to give the sequence that begins $$1, 2, 4, 10, 26, 72, 206, 606, 1820,$$ which is essentially \seqnum{A102407}.
\item
The case  $\left(
\begin{array}{ccc}
 1 & 1 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ gives us
\begin{align*}u(x)=f(x)&=\frac{1-x-x^2-\sqrt{1-2x-5x^2-6x^3-3x^4}}{2x(1+x)}\\
&=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2(1+x)^2}}{2x(1+x)}.\end{align*}
The corresponding equation
$$T_{n,k}=T_{n-1,k-1}+T_{n-1,k}+T_{n-1,k+1}+T_{n-2,k-1}+T_{n-2,k}+T_{n-2,k+1}$$ leads to the Riordan array $(g(x), (1+x)xg(x))$ where $f(x)=x(1+x)g(x)$, that begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 3 & 1 & 0 & 0 & 0 \\
 8 & 9 & 5 & 1 & 0 & 0 \\
 23 & 29 & 19 & 7 & 1 & 0 \\
 69 & 93 & 70 & 33 & 9 & 1 \\
\end{array}
\right).$$
In this case, the generating function $f(x)/x$ expands to give the sequence that begins
$$1, 2, 4, 11, 31, 92, 283, 893, 2875,\ldots.$$
This is essentially \seqnum{A247333}.
\end{itemize}

To each of the cases above, we can associate an elliptic curve.
\begin{itemize}
\item To the case of   $\left(
\begin{array}{ccc}
 0 & 0 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+xy-y=-x^2.$$
Solving this for $y$ gives $y=\frac{1-x-\sqrt{1-2x-3x^2}}{2}$. Equivalently, the solution to
$$xy^2+xy-y=-x$$ gives $y=\frac{1-x-\sqrt{1-2x-3x^2}}{2x}$.
\item
To the case of $\left(
\begin{array}{ccc}
 0 & 0 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+xy-y=-x^3-x^2,$$ which yields
$$y=\frac{1-x-\sqrt{1-2x-3x^2-4x^3}}{2}.$$
Note then that
$$(1+x)^2x^2y^2+(1+x)x^2y-(1+x)y=-x^3-x^2$$ gives
$$y=\frac{1-x-\sqrt{1-2x-3x^2-4x^3}}{2x^2(1+x)}.$$
\item
To the case of   $\left(
\begin{array}{ccc}
 0 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+x^2y+xy-y=-x^2.$$ This yields
$$y=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2}}{2}.$$
Alternatively,
$$xy^2+x^2y+xy-y=-x$$ yields
$$y=\frac{1-x-x^2-\sqrt{(1-x-x^2)^2-4x^2}}{2x}.$$
\item
To the case of   $\left(
\begin{array}{ccc}
 0 & 1 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+x^2y+xy-y=-x^3-x^2,$$ which gives
$$y=\frac{1-x-x^2-\sqrt{1-2x-5x^2-2x^3+x^4}}{2}.$$
Alternatively we have the curve with equation
$$(xy(1+x))^2+x^2(xy(1+x))+x(xy(1+x))-(xy(1+x))=-x^3-x^2,$$ which gives
$$y=\frac{1-x-x^2-\sqrt{1-2x-5x^2-2x^3+x^4}}{2x(1+x)}.$$
\item
To the case of   $\left(
\begin{array}{ccc}
 1 & 0 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+xy-y=-x^3-x^2.$$
\item
To the case of $\left(
\begin{array}{ccc}
 1 & 0 & 1 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+xy-y=-x^4-2x^3-x^2,$$ which yields
$$y=\frac{1-x-\sqrt{1-2x-3x^2-8x^3-4x^4}}{2}.$$
\item
To the case of $\left(
\begin{array}{ccc}
 1 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+x^2y_xy-y=-x^3-x^2.$$
\item
To the case of $\left(
\begin{array}{ccc}
 1 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right)$ we can associate the curve of equation
$$y^2+x^2y+xy-y=-x^4-2x^3-x^2,$$ which yields
$$y=\frac{1-x-x^2-\sqrt{1-2x-5x^2-6x^3-3x^4}}{2}.$$
The change of variable $y \to xy(1+x)$ then yields $y=f(x)$ as
$$y=\frac{1-x-x^2-\sqrt{1-2x-5x^2-6x^3-3x^4}}{2x(1+x)}.$$
\end{itemize}
\section{$3$-generalized Motzkin paths}
Using the nomenclature of \cite{Ramirez}, we shall understand by a \emph{$3$-generalized Motzkin path} a path with unit up and down steps given, respectively, by $(1,1)$ and $(1,-1)$, and three horizontal steps $h$,$H$, and $\mathcal{H}$ of lengths, respectively, of $1$, $2$, and $3$. Such paths are enumerated by the sequence which begins
$$1, 1, 3, 7, 18, 48, 132, 372, 1069, 3121, 9232, 27610, \ldots.$$
We find that the generating function $g_3(x)$ of these $3$-generalized Motzkin paths is given by the continued fraction expression
$$g_3(x)=\cfrac{1}{1-x-x^2-x^3-\cfrac{x^2}{1-x-x^2-x^3-\cfrac{x^2}{1-x-x^2-x^3-\cdots}}}.$$
Solving the equation
$$u=\frac{1}{1-x-x^2-x^3-x^2 u},$$ we find that
$$u=u(x)=g_3(x)=\frac{1-x-x^2-x^3-\sqrt{1-2x-5x^2+3x^4+2x^5+x^6}}{2x^2},$$ or equivalently \cite{Yang}
$$g_3(x)=\frac{1-x-x^2-x^3-\sqrt{(1-x-x^2-x^3)^2-4x^2}}{2x^2}.$$
The number triangle given by the Riordan array $(g_3(x), xg_3(x))$ begins
$$\left(
\begin{array}{cccccc}
 1 & 0 & 0 & 0 & 0 & 0 \\
 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 2 & 1 & 0 & 0 & 0 \\
 7 & 7 & 3 & 1 & 0 & 0 \\
 18 & 20 & 12 & 4 & 1 & 0 \\
 48 & 59 & 40 & 18 & 5 & 1 \\
\end{array}
\right).$$
The $A$-matrix for this Riordan array is then given by
$$\left(
\begin{array}{ccc}
 0 & 1 & 0 \\
 0 & 1 & 0 \\
 1 & 1 & 1 \\
\end{array}
\right).$$

\section{Conclusions} In this note, we have studied the enumeration of Motzkin-Schr\"oder paths in the broader context of Riordan arrays defined by an $A$-matrix of the form $A=\left(
\begin{array}{ccc}
 a & b & c \\
 1 & 1 & 1 \\
\end{array}
\right)$. The key equation for Riordan arrays defined by an $A$-matrix has allowed us to find generating functions for the resulting generalized lattice paths. In the case of the Motzkin-Schr\"oder paths, this resulting generating function is also given by a defining recurrence. Because of the appearance of the generating function of the Catalan numbers (due to the quadratic nature of the equations), the generating functions studied all admit continued fraction expressions, and we conjecture that in each case, the Hankel transform of the expansions of these generating functions give Somos-$4$ sequences.



\begin{thebibliography}{99}

\bibitem{book1} P. Barry, \emph{Riordan Arrays: a Primer}, Logic Press, 2017.

\bibitem{GenCat} P. Barry, Generalized Catalan numbers, Hankel transforms and Somos-$4$ sequences, \emph{J. Integer Sequences} \textbf{13} (2010), \href{https://cs.uwaterloo.ca/journals/JIS/VOL13/Barry1/barry95r.html}{Article 10.7.2}.

\bibitem{Chen} W. Y. C. Chen, S. H. F. Yan, and L. L. M. Yang, Weighted $2$-Motzkin paths, Arxiv preprint arXiv:math/0410200 [math.CO],
2004.  Available at \url{https://arxiv.org/abs/math/0410200}.

\bibitem{Deutsch} E. Deutsch and L. W. Shapiro, A bijection between ordered trees and $2$-Motzkin
paths and its many consequences, \emph{Discrete Math.} \textbf{256} (2002), 655--770.


\bibitem{He} T.-X. He, Matrix characterizations of Riordan arrays, \emph{Linear Alg. Appl.} \textbf{465} (2015), 15--42.

\bibitem{Hone} A. N. W. Hone, Elliptic curves and quadratic recurrence sequences, \emph{Bull. Lond. Math. Soc.} \textbf{37} (2005), 161--171.

\bibitem{horse} Q. Hou and T. Mansour, Horse paths, restricted $132$-avoiding permutations, continued fractions, and Chebyshev polynomials, \emph{Discr. Appl. Math.} \textbf{154} (2006), 1183--1197.

\bibitem{Klostermeyer} W. F. Klostermeyer, M. Mays, L. Soltes, and G. Trapp, A Pascal rhombus, \emph{Fibonacci Quart.} \textbf{35} (1997), 318--328.

\bibitem{Thron} A. E. Price and A. D. Sokal, Phylogenetic trees, augmented perfect matchings,
and a Thron-type continued fraction ($T$-fraction) for the Ward polynomials,
Arxiv preprint arXiv:2001.01468 [math.CO], March 10 2020.  Available
at \url{https://arxiv.org/abs/2001.01468}.


\bibitem{Alt} D. Merlini, D. G. Rogers, R. Sprugnoli, and M.C. Verri, On some alternative characterizations of Riordan arrays, \emph{Canad. J. Math.} \textbf{49} (1997), 301--320.

\bibitem{Propp} J. Propp, The Somos sequence site, \url{http://jamespropp.org/somos.html}.

\bibitem{Ramirez} J. L. Ramirez, The Pascal rhombus and the generalized grand Motzkin paths, \emph{Fibonacci Quart.} \textbf{54} (2015), 99--104.

\bibitem{SL1} N. J. A.~Sloane, \emph{The
On-Line Encyclopedia of Integer Sequences}. Published electronically
at \url{https://oeis.org}, 2023.

\bibitem{book2} L. Shapiro, R. Sprugnoli, P. Barry, G.-S. Cheon, T.-X. He, D. Merlini, and W. Wang, \emph{The Riordan Group and Applications}, Springer, 2022.

\bibitem{SGWW} L. W. Shapiro, S. Getu, W. J. Woan, and L. C. Woodson,
The Riordan group, \emph{Discr. Appl. Math.} \textbf{34} (1991),
 229--239.

\bibitem{SL2} N. J. A.~Sloane, The On-Line Encyclopedia of Integer
Sequences, \emph{Notices Amer. Math. Soc.} \textbf{50} (2003),  912--915.

\bibitem{Wall} H. S. Wall, \emph{Analytic Theory of Continued Fractions},
Amer. Math. Soc., 2000.

\bibitem{Yang} S.-L. Yang and Y.-Y. Gao, Pascal rhombus and Riordan array, \emph{J. Lanzhou Univ. Tech.} \textbf{44} (2020), 150--154.


\end{thebibliography}

\bigskip
\hrule
\bigskip
\noindent 2020 {\it Mathematics Subject Classification}: Primary
05A15; Secondary 11B37, 15B36, 11A55, 15A15, 15B05.

\noindent \emph{Keywords:} Schr\"oder path, Motzkin path, horse path, lattice path, recurrence, Riordan array, continued fraction, Somos sequence.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences
\seqnum{A000012},
\seqnum{A000045},
\seqnum{A000108},
\seqnum{A001006},
\seqnum{A006318},
\seqnum{A025235},
\seqnum{A059317},
\seqnum{A059345},
\seqnum{A059398},
\seqnum{A059841},
\seqnum{A060693},
\seqnum{A064189},
\seqnum{A071359},
\seqnum{A078481},
\seqnum{A084782},
\seqnum{A085139},
\seqnum{A102407},
\seqnum{A103210},
\seqnum{A128720},
\seqnum{A132276},
\seqnum{A132277},
\seqnum{A143013},
\seqnum{A174168},
\seqnum{A184019},
\seqnum{A190156},
\seqnum{A190252}, and
\seqnum{A247333}.)


\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received  April 29 2022;
revised version received  May 3 2023.
Published in {\it Journal of Integer Sequences}, May 9 2023.

\bigskip
\hrule
\bigskip

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


\end{document}

                                                                                

