Massimo Nocentini

March 2, 2018: compositional inverse
February 26, 2018: splitting from generic nb



Abstract
Ctors for (symbolic) Riordan arrays.

In [1]:
from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, t, alpha

from sequences import *

init_printing()

In [2]:
m = 5
d_fn, h_fn = Function('d'), Function('h')
d, h = IndexedBase('d'), IndexedBase('h')


In [3]:
rows, cols = 5, 5
ctor = lambda i,j: d[i,j]
Matrix(rows, cols, ctor)


Out[3]:
$$\left[\begin{matrix}d_{0,0} & d_{0,1} & d_{0,2} & d_{0,3} & d_{0,4}\\d_{1,0} & d_{1,1} & d_{1,2} & d_{1,3} & d_{1,4}\\d_{2,0} & d_{2,1} & d_{2,2} & d_{2,3} & d_{2,4}\\d_{3,0} & d_{3,1} & d_{3,2} & d_{3,3} & d_{3,4}\\d_{4,0} & d_{4,1} & d_{4,2} & d_{4,3} & d_{4,4}\end{matrix}\right]$$

By series convolution


In [4]:
d_series = Eq(d_fn(t), 1+sum(d[i]*t**i for i in range(1,m)))
h_series = Eq(h_fn(t), t*(1+sum(h[i]*t**i for i in range(1,m-1)))).expand()

d_series, h_series


Out[4]:
$$\left ( d{\left (t \right )} = t^{4} d_{4} + t^{3} d_{3} + t^{2} d_{2} + t d_{1} + 1, \quad h{\left (t \right )} = t^{4} h_{3} + t^{3} h_{2} + t^{2} h_{1} + t\right )$$

In [5]:
R = Matrix(m, m, riordan_matrix_by_convolution(m, d_series, h_series))
R


Out[5]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0\\d_{1} & 1 & 0 & 0 & 0\\d_{2} & d_{1} + h_{1} & 1 & 0 & 0\\d_{3} & d_{1} h_{1} + d_{2} + h_{2} & d_{1} + 2 h_{1} & 1 & 0\\d_{4} & d_{1} h_{2} + d_{2} h_{1} + d_{3} + h_{3} & 2 d_{1} h_{1} + d_{2} + h_{1}^{2} + 2 h_{2} & d_{1} + 3 h_{1} & 1\end{matrix}\right]$$

In [6]:
production_matrix(R) # too verbose to show


Out[6]:
$$\left[\begin{matrix}d_{1} & 1 & 0 & 0\\- d_{1}^{2} + d_{2} & h_{1} & 1 & 0\\\left(\left(d_{1} + h_{1}\right) d_{1} - d_{2}\right) d_{1} - \left(d_{1} + h_{1}\right) d_{2} + d_{3} & - h_{1}^{2} + h_{2} & h_{1} & 1\\- \left(d_{1} + 2 h_{1}\right) d_{3} - \left(\left(\left(d_{1} + h_{1}\right) d_{1} - d_{2}\right) \left(d_{1} + 2 h_{1}\right) - \left(d_{1} h_{1} + d_{2} + h_{2}\right) d_{1} + d_{3}\right) d_{1} - \left(- \left(d_{1} + h_{1}\right) \left(d_{1} + 2 h_{1}\right) + d_{1} h_{1} + d_{2} + h_{2}\right) d_{2} + d_{4} & 2 h_{1}^{3} - 3 h_{1} h_{2} + h_{3} & - h_{1}^{2} + h_{2} & h_{1}\end{matrix}\right]$$

In [7]:
d_series = Eq(d_fn(t), 1/(1-t))
h_series = Eq(h_fn(t), t*d_series.rhs)

d_series, h_series


Out[7]:
$$\left ( d{\left (t \right )} = \frac{1}{- t + 1}, \quad h{\left (t \right )} = \frac{t}{- t + 1}\right )$$

In [8]:
R = Matrix(10, 10, riordan_matrix_by_convolution(10, d_series, h_series))
R


Out[8]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 3 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 4 & 6 & 4 & 1 & 0 & 0 & 0 & 0 & 0\\1 & 5 & 10 & 10 & 5 & 1 & 0 & 0 & 0 & 0\\1 & 6 & 15 & 20 & 15 & 6 & 1 & 0 & 0 & 0\\1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 & 0 & 0\\1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 & 0\\1 & 9 & 36 & 84 & 126 & 126 & 84 & 36 & 9 & 1\end{matrix}\right]$$

By recurrence relation


In [9]:
dim = 5
a, b, b_bar, c = symbols(r'a b \bar{b} c')
M = Matrix(dim, dim, 
           riordan_matrix_by_recurrence(
               dim, lambda n, k: {(n-1, k-1):a, 
                                  (n-1, k): b if k else b_bar, 
                                  (n-1, k+1):c}))
M


Out[9]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0\\\bar{b} & a & 0 & 0 & 0\\\bar{b}^{2} + a c & \bar{b} a + a b & a^{2} & 0 & 0\\\bar{b}^{3} + 2 \bar{b} a c + a b c & \bar{b}^{2} a + \bar{b} a b + 2 a^{2} c + a b^{2} & \bar{b} a^{2} + 2 a^{2} b & a^{3} & 0\\\bar{b}^{4} + 3 \bar{b}^{2} a c + 2 \bar{b} a b c + 2 a^{2} c^{2} + a b^{2} c & \bar{b}^{3} a + \bar{b}^{2} a b + 3 \bar{b} a^{2} c + \bar{b} a b^{2} + 5 a^{2} b c + a b^{3} & \bar{b}^{2} a^{2} + 2 \bar{b} a^{2} b + 3 a^{3} c + 3 a^{2} b^{2} & \bar{b} a^{3} + 3 a^{3} b & a^{4}\end{matrix}\right]$$

In [10]:
production_matrix(M)


Out[10]:
$$\left[\begin{matrix}\bar{b} & a & 0 & 0\\c & b & a & 0\\0 & c & b & a\\0 & 0 & c & b\end{matrix}\right]$$

In [11]:
Msubs = M.subs({a:1, b_bar:b})
Msubs, production_matrix(Msubs)


Out[11]:
$$\left ( \left[\begin{matrix}1 & 0 & 0 & 0 & 0\\b & 1 & 0 & 0 & 0\\b^{2} + c & 2 b & 1 & 0 & 0\\b^{3} + 3 b c & 3 b^{2} + 2 c & 3 b & 1 & 0\\b^{4} + 6 b^{2} c + 2 c^{2} & 4 b^{3} + 8 b c & 6 b^{2} + 3 c & 4 b & 1\end{matrix}\right], \quad \left[\begin{matrix}b & 1 & 0 & 0\\c & b & 1 & 0\\0 & c & b & 1\\0 & 0 & c & b\end{matrix}\right]\right )$$

By $A, Z$ sequences

$\mathcal{P}$


In [12]:
A, Z = Function('A'), Function('Z')
A_eq = Eq(A(t), 1 + t)
Z_eq = Eq(Z(t),1)
A_eq, Z_eq


Out[12]:
$$\left ( A{\left (t \right )} = t + 1, \quad Z{\left (t \right )} = 1\right )$$

In [13]:
R = Matrix(10, 10, riordan_matrix_by_AZ_sequences(10, (Z_eq, A_eq)))
R, production_matrix(R)


Out[13]:
$$\left ( \left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 3 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 4 & 6 & 4 & 1 & 0 & 0 & 0 & 0 & 0\\1 & 5 & 10 & 10 & 5 & 1 & 0 & 0 & 0 & 0\\1 & 6 & 15 & 20 & 15 & 6 & 1 & 0 & 0 & 0\\1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 & 0 & 0\\1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1 & 0\\1 & 9 & 36 & 84 & 126 & 126 & 84 & 36 & 9 & 1\end{matrix}\right], \quad \left[\begin{matrix}1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\end{matrix}\right]\right )$$

$\mathcal{C}$


In [14]:
A = Function('A')
A_ones = Eq(A(t), 1/(1-t))
R = Matrix(10, 10, riordan_matrix_by_AZ_sequences(10, (A_ones, A_ones)))
R, production_matrix(R)


Out[14]:
$$\left ( \left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\2 & 2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\5 & 5 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\14 & 14 & 9 & 4 & 1 & 0 & 0 & 0 & 0 & 0\\42 & 42 & 28 & 14 & 5 & 1 & 0 & 0 & 0 & 0\\132 & 132 & 90 & 48 & 20 & 6 & 1 & 0 & 0 & 0\\429 & 429 & 297 & 165 & 75 & 27 & 7 & 1 & 0 & 0\\1430 & 1430 & 1001 & 572 & 275 & 110 & 35 & 8 & 1 & 0\\4862 & 4862 & 3432 & 2002 & 1001 & 429 & 154 & 44 & 9 & 1\end{matrix}\right], \quad \left[\begin{matrix}1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0\\1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0\\1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0\\1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0\\1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1\\1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1\end{matrix}\right]\right )$$

$\mathcal{R}$


In [15]:
dim = 5
A = Function('A')
a = IndexedBase('a')
A_gen = Eq(A(t), sum((a[j] if j else 1)*t**j for j in range(dim)))
R = Matrix(dim, dim, riordan_matrix_by_AZ_sequences(dim, (A_gen, A_gen)))
R


Out[15]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0\\a_{1} + 1 & a_{1} + 1 & 1 & 0 & 0\\a_{1}^{2} + 2 a_{1} + a_{2} + 1 & a_{1}^{2} + 2 a_{1} + a_{2} + 1 & 2 a_{1} + 1 & 1 & 0\\a_{1}^{3} + 3 a_{1}^{2} + 3 a_{1} a_{2} + 3 a_{1} + 2 a_{2} + a_{3} + 1 & a_{1}^{3} + 3 a_{1}^{2} + 3 a_{1} a_{2} + 3 a_{1} + 2 a_{2} + a_{3} + 1 & 3 a_{1}^{2} + 3 a_{1} + 2 a_{2} + 1 & 3 a_{1} + 1 & 1\end{matrix}\right]$$

In [16]:
z = IndexedBase('z')
A_gen = Eq(A(t), sum((a[j] if j else 1)*t**j for j in range(dim)))
Z_gen = Eq(Z(t), sum((z[j] if j else 1)*t**j for j in range(dim)))
Raz = Matrix(dim, dim, riordan_matrix_by_AZ_sequences(dim, (Z_gen, A_gen)))
Raz


Out[16]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0\\z_{1} + 1 & a_{1} + 1 & 1 & 0 & 0\\a_{1} z_{1} + 2 z_{1} + z_{2} + 1 & a_{1}^{2} + a_{1} + a_{2} + z_{1} + 1 & 2 a_{1} + 1 & 1 & 0\\a_{1}^{2} z_{1} + 2 a_{1} z_{1} + 2 a_{1} z_{2} + a_{2} z_{1} + z_{1}^{2} + 3 z_{1} + 2 z_{2} + z_{3} + 1 & a_{1}^{3} + a_{1}^{2} + 3 a_{1} a_{2} + 2 a_{1} z_{1} + a_{1} + a_{2} + a_{3} + 2 z_{1} + z_{2} + 1 & 3 a_{1}^{2} + 2 a_{1} + 2 a_{2} + z_{1} + 1 & 3 a_{1} + 1 & 1\end{matrix}\right]$$

In [17]:
production_matrix(R), production_matrix(Raz)


Out[17]:
$$\left ( \left[\begin{matrix}1 & 1 & 0 & 0\\a_{1} & a_{1} & 1 & 0\\a_{2} & a_{2} & a_{1} & 1\\a_{3} & a_{3} & a_{2} & a_{1}\end{matrix}\right], \quad \left[\begin{matrix}1 & 1 & 0 & 0\\z_{1} & a_{1} & 1 & 0\\z_{2} & a_{2} & a_{1} & 1\\z_{3} & a_{3} & a_{2} & a_{1}\end{matrix}\right]\right )$$

Compositional inverse


In [18]:
H = Function('h')
C_eq = Eq(H(t), (1-sqrt(1-4*t))/2)
C_eq, compositional_inverse(C_eq)


Out[18]:
$$\left ( h{\left (t \right )} = - \frac{1}{2} \sqrt{- 4 t + 1} + \frac{1}{2}, \quad \bar{ h }{\left (y \right )} = - y \left(y - 1\right)\right )$$

In [19]:
P_eq = Eq(H(t), t/(1-t))
(P_eq, 
 compositional_inverse(P_eq), 
 compositional_inverse(compositional_inverse(P_eq), y=t))


Out[19]:
$$\left ( h{\left (t \right )} = \frac{t}{- t + 1}, \quad \bar{ h }{\left (y \right )} = \frac{y}{y + 1}, \quad \bar{ \bar{ h } }{\left (t \right )} = - \frac{t}{t - 1}\right )$$

Group inverse


In [20]:
d_series = Eq(d_fn(t), 1/(1-t))
h_series = Eq(h_fn(t), t/(1-t))
P_inverse = group_inverse(d_series, h_series)
P_inverse


Out[20]:
$$\left ( g{\left (t \right )} = \frac{1}{t + 1}, \quad f{\left (t \right )} = \frac{t}{t + 1}\right )$$

In [21]:
R = Matrix(10, 10, riordan_matrix_by_convolution(10, *P_inverse))
R, production_matrix(R)


Out[21]:
$$\left ( \left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\-1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\-1 & 3 & -3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\1 & -4 & 6 & -4 & 1 & 0 & 0 & 0 & 0 & 0\\-1 & 5 & -10 & 10 & -5 & 1 & 0 & 0 & 0 & 0\\1 & -6 & 15 & -20 & 15 & -6 & 1 & 0 & 0 & 0\\-1 & 7 & -21 & 35 & -35 & 21 & -7 & 1 & 0 & 0\\1 & -8 & 28 & -56 & 70 & -56 & 28 & -8 & 1 & 0\\-1 & 9 & -36 & 84 & -126 & 126 & -84 & 36 & -9 & 1\end{matrix}\right], \quad \left[\begin{matrix}-1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & -1 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & -1 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & -1 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & -1 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & -1 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0 & -1 & 1 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & 1\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1\end{matrix}\right]\right )$$

In [22]:
catalan_term = (1-sqrt(1-4*t))/(2*t)
d_series = Eq(d_fn(t), catalan_term)
h_series = Eq(h_fn(t), t*catalan_term)
C_inverse = group_inverse(d_series, h_series, post=radsimp)
C_inverse


Out[22]:
$$\left ( g{\left (t \right )} = \frac{1}{2} \sqrt{4 t^{2} - 4 t + 1} + \frac{1}{2}, \quad f{\left (t \right )} = t \left(- t + 1\right)\right )$$

In [23]:
R = Matrix(10, 10, riordan_matrix_by_convolution(10, C_inverse[0], C_inverse[1]))
R


Out[23]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\-1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & -3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 3 & -4 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 0 & -1 & 6 & -5 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 0 & -4 & 10 & -6 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 1 & -10 & 15 & -7 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 5 & -20 & 21 & -8 & 1 & 0\\0 & 0 & 0 & 0 & -1 & 15 & -35 & 28 & -9 & 1\end{matrix}\right]$$

Exponential RA

build the triangle of Stirling numbers of the II kind


In [24]:
d_series = Eq(d_fn(t), 1)
h_series = Eq(h_fn(t), exp(t)-1)
d_series, h_series


Out[24]:
$$\left ( d{\left (t \right )} = 1, \quad h{\left (t \right )} = e^{t} - 1\right )$$

In [25]:
R = Matrix(10, 10, riordan_matrix_exponential(
            riordan_matrix_by_convolution(10, d_series, h_series)))
R


Out[25]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 7 & 6 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 15 & 25 & 10 & 1 & 0 & 0 & 0 & 0\\0 & 1 & 31 & 90 & 65 & 15 & 1 & 0 & 0 & 0\\0 & 1 & 63 & 301 & 350 & 140 & 21 & 1 & 0 & 0\\0 & 1 & 127 & 966 & 1701 & 1050 & 266 & 28 & 1 & 0\\0 & 1 & 255 & 3025 & 7770 & 6951 & 2646 & 462 & 36 & 1\end{matrix}\right]$$

In [26]:
production_matrix(R), production_matrix(R, exp=True)


Out[26]:
$$\left ( \left[\begin{matrix}0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 2 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 3 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 4 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 5 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 6 & 1 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 7 & 1\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 8\end{matrix}\right], \quad \left[\begin{matrix}0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 1 & 2 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 2 & 3 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 3 & 4 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 4 & 5 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 5 & 6 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 6 & 7 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 7 & 8\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 8\end{matrix}\right]\right )$$

In [27]:
inspect(R)


Out[27]:
nature(is_ordinary=False, is_exponential=True)

In [30]:
d_series = Eq(d_fn(t), 1/(1-t))
h_series = Eq(h_fn(t), t/(1-t))
d_series, h_series


Out[30]:
$$\left ( d{\left (t \right )} = \frac{1}{- t + 1}, \quad h{\left (t \right )} = \frac{t}{- t + 1}\right )$$

In [31]:
R = Matrix(10, 10, riordan_matrix_exponential(
            riordan_matrix_by_convolution(10, d_series, h_series)))
R


Out[31]:
$$\left[\begin{matrix}1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\2 & 4 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\6 & 18 & 9 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\24 & 96 & 72 & 16 & 1 & 0 & 0 & 0 & 0 & 0\\120 & 600 & 600 & 200 & 25 & 1 & 0 & 0 & 0 & 0\\720 & 4320 & 5400 & 2400 & 450 & 36 & 1 & 0 & 0 & 0\\5040 & 35280 & 52920 & 29400 & 7350 & 882 & 49 & 1 & 0 & 0\\40320 & 322560 & 564480 & 376320 & 117600 & 18816 & 1568 & 64 & 1 & 0\\362880 & 3265920 & 6531840 & 5080320 & 1905120 & 381024 & 42336 & 2592 & 81 & 1\end{matrix}\right]$$

In [32]:
production_matrix(R), production_matrix(R, exp=True)


Out[32]:
$$\left ( \left[\begin{matrix}1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 4 & 5 & 1 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 9 & 7 & 1 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 16 & 9 & 1 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 25 & 11 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 36 & 13 & 1 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 49 & 15 & 1\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 64 & 17\end{matrix}\right], \quad \left[\begin{matrix}1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\1 & 3 & 2 & 0 & 0 & 0 & 0 & 0 & 0\\0 & 2 & 5 & 3 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 3 & 7 & 4 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 4 & 9 & 5 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 5 & 11 & 6 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 6 & 13 & 7 & 0\\0 & 0 & 0 & 0 & 0 & 0 & 7 & 15 & 8\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 8 & 17\end{matrix}\right]\right )$$

In [33]:
inspect(R)


Out[33]:
nature(is_ordinary=False, is_exponential=True)