GENERALIZING DELANNOY NUMBERS VIA COUNTING WEIGHTED LATTICE PATHS

The aim of this paper is to introduce a generalization of Delannoy numbers. The standard Delannoy numbers count lattice paths from (0, 0) to (n, k) consisting of horizontal (1, 0), vertical (0, 1), and diagonal (1, 1) steps called segments. We assign weights to the segments of the lattice paths, and we sum weights of all lattice paths from any (a, b) to (n, k). Generating functions for the generalized Delannoy numbers and weighted central Delannoy numbers are delivered and some consequences of them are drawn. Several identities, summations, and convolution-like formulas for the general case are given. We show how our approach may be used in counting lattice paths with certain restrictions. Namely, we remove certain classes of segments from the complete lattice and then we ask about the number of paths in such modified lattices. In the last section we show how these numbers generalize, among others, binomial, q-binomial coe cients, ordinary Stirling numbers of both kinds, and p, q-Stirling numbers. Applying the results of generalized Delannoy numbers we deliver a q-Vandermonde identity and a generalized Carlitz-like formula for p, q-binomial coe cients.

From the recurrence relation one can obtain the generating function X n,k 0 D(n, k)x k y n = 1 1 x y xy . (1.1) Figure 1: A lattice path from the set L(4, 2).
We refer the reader to Banderier and Schwer [3].From the generating function it follows that There are several ways of generalizing Delannoy numbers in the literature.Wagner [28] defines some statistics on lattice paths.Autebert and Schwer [2] extend this 2-dimensional case to the d-dimensional space Z d , where d > 2. See also Caughman, Haithcock and Veerman [5].The main idea of our approach is to assign weights to the segments of a lattice and to sum weights of paths.This idea has been previously used by Fray and Roselle [13], Hetyei [17] and Loehr and Savage [21,Sec. 3.2].
including binomial, q-binomial coe cients, Stirling numbers of both kinds, p, q-Stirling numbers [27], ⇣-analogues [12] (see Section 8).For B = h1, 1, 1, 1i, where 1 = (1, 1, . ..), the B-Delannoy numbers reduce to the ordinary Delannoy numbers, i.e., ⌧ n k B = D(n, k). (1.4) In Section 3 we show that the generating function for the general case of the L-Delannoy numbers is In Section 4 we consider central weighted Delannoy numbers studied by Fray and Roselle [13], and Hetyei [17].Namely, let W = hv c , h c , d c , 1i, where v c = (v, v, . ..), h c = (h, h, . ..), d c = (d, d, . ..) are constant sequences of v, h, d 2 C. We show that We define two reduced cases of the generalized Delannoy numbers.Namely, for a given 4-tuple L = hv, h, d, ⇣i we set L 1 = h0, h, d, ⇣i and L 2 = hv, 1, 0, ⇣i, where 0 = (0, 0, . ..).By the L-Delannoy numbers of the first kind (expressed in square brackets) we mean L 1 -Delannoy numbers, and by the L-Delannoy numbers of the second kind (expressed in curly brackets) we mean L 2 -Delannoy numbers, i.e., It turns out that (1.2) has a natural generalization for L-Delannoy numbers of the first and second kind, that is, which follows from the generating function.However, a combinatorial proof is given in Section 2. The generalization of the Carlitz formula is delivered in Section 3 (Theorem 10) for the L-Delannoy numbers of the first and second kind.That is, where H = hv, 1, d, ⇣i and In Section 5 we study the case where the sequences v, h, and d take values over the set {0, 1} which allows to count Delannoy paths with certain restrictions.Namely, paths whose steps have weight equal to zero are omitted in the sum.Therefore, by setting certain elements of v, h, and d to zero we remove corresponding steps of the lattices.Let H = H( , ⌧, ⌘) be a family of steps (see Section 5), we denote by D(n, k; H) the number of Delannoy paths from (0, 0) to (n, k) which consist of steps from H. We show that where , ⌧ ✓ {1, 2, . . ., n} such that ⌧ \ = ;, and ⌘ ✓ {0, 1, . . ., n}.
In Section 6 we generalize previous results to the case where weighted Delannoy paths begin at any lattice point (m, l).Let x, y be any two lattice points, and let us denote by L[x, y] the set of all Delannoy paths from x to y.
where x = (m, l) and y = (m + n, l + k).Although, this generalization does not give essentially new results but provides a convenient notation for some new convolutionlike formulae given in Section 6.
In Section 7 we show the connection between these generalized Delannoy numbers and partitions of numbers.We show, for instance, that for certain 4-tuples P(H), the P(H)-Delannoy numbers of the first and second kind are generating functions of certain sequences counting partitions of numbers, i.e.,  where D(H; n, k), and R(H; n, k) are the families of partitions of n into k distinct parts from the set H without and with repetition of parts allowed, respectively.
In Section 8 we show how L-Delannoy numbers generalize binomial and q-binomial coe cients, ordinary Stirling numbers of both kinds, and p, q-Stirling numbers.

Counting Lattice Paths with Diagonals
For n, k 0, the L-Delannoy numbers satisfy the following recurrence relation with initial value ⌦ 0 0 ↵ L = 1.We assume that ⌦ n k ↵ L = 0 for n < 0 or k < 0. We denote by L 1 (n, k) the set of all lattice paths from (0, 0) to (n, k) consisting of only horizontal and diagonal steps, and by L 2 (n, k) the set of lattice paths from (0, 0) to (n, k) consisting of vertical and horizontal steps (see Fig. 3).With this notation, we have Let D 1 (n, k) and D 2 (n, k) denote the cardinalities of the sets L 1 (n, k) and L 2 (n, k), respectively.It is well-known that The L-Delannoy numbers of the first and second kind satisfy the following recurrence relations with initial values Let us denote by L(n, k, j) the set of those paths from L(n, k) which contain exactly j diagonal steps.Observe that any path contains at most min(n, k) diagonal steps, and thus which immediately implies (1.2).In fact, we show a generalization of this result for the L-Delannoy numbers.
Theorem 1.For n, k 0, we have Proof.We divide the proof into three lemmas.Let us consider the left-hand side of (2.3).By Lemma 2 and Lemma 4, we show that Note that the ith summand of the right-hand side of (2.3) is the sum of weights of these Delannoy paths which consist of exactly i diagonal steps.Let = ((a, b), (c, d)) and = ((e, f ), (g, h)) be two lattice segments.We write s if a = e and c = g.We set x( ) = c, and y( ) = b.We define two operations on segments: up( ) = ((a, b + 1), (c, d + 1)), and if is horizontal, then dg( ) = ((a, b), (c, d + 1)), and dg( ) = otherwise.
Lemma 2. There is a bijection f : Proof.The proof consists in the construction of the bijection f : L 1 (n, j)⇥L 2 (n, k j) !L(n, k, j).
Step i for i = 1, 2, . . ., j. Suppose that the ith diagonal segment of ↵ is ↵ l (counting from the left-hand side).There is only one segment ⇡ r of ⇡ such that ↵ l s ⇡ r .We apply the operation dg on ⇡ r , i.e., ⇡ r := dg(⇡ r ).Next, for all next segments ⇡ r+1 , . . ., ⇡ n+k j of ⇡, we apply the operation up, i.e., for all ⇡ m such that m = r + 1, r + 2, . . ., n + k j, we set ⇡ m := up(⇡ m ).It is easy to check that after these j + 1 steps the path ⇡ is one of the set L(n, k, j).
( ) Simply executing f in reverse order gives f 1 .
Two paths ↵ 2 L 1 (3, 2), 2 L 2 (3, 2) and corresponding f (↵, ) 2 L(3, 4) are given in Fig. 4. Lemma 3. Let ⇡ 2 L(n, k, j) and ↵ 2 L 1 (n, j), 2 L 2 (n, k j) such that ⇡ = f (↵, ).For i = 1, 2, . . ., n, if ↵ i is the ith segment of ↵, and l , ⇡ l are segments of and ⇡, respectively, such that ↵ i s l s ⇡ l , then Proof.Consider the construction of f given in the proof of Lemma 2. From the 0th step we see that y(⇡ l ) = y( l ).In the next j consecutive steps we raise up, by the operation up, certain segments of ⇡ such that the first segment of ⇡ begins at (0, 0) and the last one ends at (n, k).
Observe that the value of y(↵ i ) determines the number of diagonal segments ↵ b 2 ↵ for which we have x(↵ b ) < x(↵ i ).Thus the value of y for ⇡ l is increased from y( l ) by the number y(↵ i ) which is equivalent to the number of up operations applied to ⇡ l . (2.4) be the sequences of all vertical, horizontal, and diagonal segments of ⇡, respectively, in the ascending order of x.In the same manner we define the sets ↵ h , ↵ d , and h , v .With this notation, we have We rewrite (2.4) as The proof is divided into three parts.
(a) First, we show that To see this, observe that the weight function w L on vertical segments depends only on the sequence {v n } n 0 .For i = 1, 2, . . ., k j, denote . By the definition of w L , we see that Let us observe that the corresponding vertical segments v of the path and ⇡ v of ⇡ share a common value of x, i.e., x(⇡ v i ) = x( v i ) for i = 1, 2, . . ., k j.Indeed, operations up and dg do not change the first coordinate of the segments' points.

Let us divide
. By definition, we see that and observe that for i = 1, . . ., n j, we have Thus by the definitions of w L1 and w L2 , we have Thus we apply Lemma 3 to the values of y for these segments to get which is exactly (2.5).
(c) In the same manner we can show the equivalent formula for diagonal segments, i.e., and y i = y(⇡ d i ), then the left-hand side of the above is equal to The rest of the proof of (c) goes much the same way as in (b).What is left is to observe that the product of the left-hand sides of (a), (b), and (c) is equal to and the product of the right-hand sides of (a), (b), and (c) is equal to Proposition 5 (Vertical summation).For n, k 2 N , we have Proof.Let us consider the left-hand side of the equation, and observe that the family L(n, k) can be partitioned into classes A 0 , . . ., A k , such that A i contains paths which have the diagonal segment Thus the weight of ⇡ is equal to the product of its segments' weights from (0, 0) to (n 1, k) times the weight of the segment h k .Therefore, by definition, we have All the remaining segments ⇡ l+2 , . . ., ⇡ s are vertical, and their number equals (k i 1).Thus, by definition, we have (c) In the same manner we compute the weight of a path ⇡ from the class A i which contains the horizontal segment h i , where i = 0, 1, . . ., k 1.We need to observe that the number of vertical segments in this case is equal to (k i), and thus The rest of the proof is straightforward.
Proposition 6 (Horizontal summation).For n, k 2 N , we have where Proof.We only outline the proof.We partition the set of paths L(n, k) into A 0 , A 1 , . . ., A n defined as follows.Take a path ⇡ from L(n, k).If ⇡ contains the vertical segment v i = ((i, k 1), (i, k)) or the diagonal segment d i = ((i, k 1), (i + 1, k)), then ⇡ 2 A i for i = 0, 1, . . ., n.Note that the class A n contains paths whose last segment is vertical v k , and w L ( v k ) = v n .The union of A 0 , . . ., A n is the whole L(n, k).Therefore, The rest of the proof can be handled in much the same way as the proof of Proposition 5.
The corresponding generating functions for the L-Delannoy numbers of the first and second kind are denoted by C n (z) and S n (z), respectively.We have C 0 (z) = 1, Note that there is another, very simple proof of Theorem 1 using the generating functions.Indeed, for every n 0, we have Proposition 8 (Symmetric-like functions).For n, k 0, we have where ⇡ = {⇡ 1 , . . ., ⇡ k }, and ⇡ = {⇡ 1 , . . ., ⇡ n k }.
Corollary 9.For n, k 0, we have where Proof.Combining Proposition 8 with (2.3) we obtain the formula.
Theorem 10 (Generalization of the Carlitz formula).Let H = hv, 1, d, ⇣i and Let us consider a power series of the product where i = ⇡ si for i = 1, 2, . . ., k j.What is left is to combine the above with (3.7), and prove that Indeed, k j variables i = ⇡ si take values over the set {1, . . ., n}, and the remaining j variables ⇡ l of ⇡ 1 , . . ., ⇡ k we can choose from the set [n]\{ 1 , . . ., k j } in n (k j) j ways.By definition, the right-hand side of the above is the value of the H ⇤ -Delannoy number of the first kind.(b) Substituting What is left is to show First, observe that (k j) variables ⌫ 1 = s1 , . . ., ⌫ k j = s k j take values over the set {0, 1, . . ., n} with repetition allowed.The remaining j variables l variables lie between these ⌫ i and depend on values Denote by A = A(n, k, j, ⌫ 1 , . . ., ⌫ k j ) the number of ways to select these remaining ⌫ l , where l 6 = s i for i = 1, 2, . . ., k j.We have Using standard methods of generating functions [29] we obtain Since there are k j + 1 terms we have which completes the proof.
Note that the generalization of Carlitz formulae for the generalized Stirling numbers delivered by Médicis and Leroux [22, Th.2.2] is a special case of the above with ⇣ = 1 and ↵ 2 = w 0 (see Section 8.6 for more details).
Then for all n, k 2 N , we have Proof.We need to observe that for every integer n 1, the generating functions C n (z) and S n (z) of the I-Delannoy numbers of the first and second kind satisfy Proposition 12. Let n, k 0. If for every 0  i, j  n such that i 6 = j we have v i 6 = v j ⇣ i j , then Proof.Using the partial fraction decomposition of the generating function (3.2) we obtain To find the coe cients W 0 , W 1 , . . ., W n we multiply both sides by The rest of the proof is straightforward.
Theorem 13.Let n, k 0, if h i 6 = 0 for i 1, then where Proof.Let us consider the following equality @/@z log(F n (z)) = 1/F n (z)@/@zF n (z).We insert the power series expansion of F n (z) and @/@zF n (z) to get @ @z log Using the Cauchy product of the series in the left-hand side and equating coe cients of like powers of z we obtain the formula.
Applying the above to the B-Delannoy numbers we obtain a recurrence relation for D(n, k), that is,

Weighted Central Delannoy Numbers
Let W = hv c , h c , d c , 1i, where v c = (v, v, . ..), h c = (h, h, . ..), d c = (d, d, . ..) are constant sequences of v, h, d 2 C. The generalized Delannoy numbers reduce to the so-called unrestricted weighted lattice paths studied, among others, by Fray and Roselle [13].They showed, for instance, that The central weighted Delannoy numbers were studied by Hetyei [17] who showed that the total weight of all Delannoy paths may be expressed by substitution into a shifted Jacobi polynomial with the appropriate parameters.Namely, where e P (0, ) n (x) is a shifted Legendre polynomial defined with the help of nth Jacobi polynomial P (0, ) n of type (0, ), i.e., e P (↵, ) n (x) = P (↵, ) n (2x 1).We refer the reader also to Sulanke [26].
Let us define auxiliary numbers.We denote by S(n) the sum of weights of all Delannoy paths from the origin to (n, n) that do not go above the line y = x.For v = h = d = 1 we obtain the sequence of the so-called large Schroeder numbers [9].The sequence {S(n)} n 0 = (1, 2, 6, 21, 77, 286, 1066, 3977, 14841, . ..) is denoted by A006318 in OEIS [23].Proposition 14. S(0) = 1, and for n = 1, 2, . .., we have Proof.We partition the family of paths from (0, 0) to (n, n) that do not go above the line y = x into two classes A and B, such that the last step of paths from A is diagonal, and the last one from B is vertical.The weighted sum of paths in A is S(n 1).To calculate the size of B we partition B into pairwise disjoint classes B 0 , B 1 , . . ., B n 1 such that B i contains these paths of B such that the last horizontal step a l = ((l, l), Let G(z) = P n 0 S(n)z n .From (4.1), the function G(z) satisfies the following functional equation which yields We take the negative square root due to the initial condition [z 0 ]G(z) = 1.
Theorem 15.For t 1 we have [z 0 ]G(z) t = 1, and for n = 1, 2, . .., we have Proof.The function G(z) satisfies the functional equation (4.2).Letting u = G(z) 1, we obtain u = z (u), where (u From the Lagrange Inversion Formula [24, Th. 5.4.2]we obtain Finally, to get the series expansion of G(z) t = (u + 1) t we use the binomial theorem, and the formula follows.
Proposition 16.For n 1, we have where a,b = 1 when a = b, and zero otherwise.
Proof.Let us partition L(n, n) into n subclasses A 1 , A 2 , . . ., A n such that paths from A k contains exactly k lattice points from the set {(1, 1), . . ., (n, n)}.We call (j, j) the jth diagonal point.Let us consider the subclass A k .These k diagonal points (j, j) can be determined by the solution of the equation where i 1 , . . ., i k 1.Indeed, the first diagonal point is (i 1 , i 1 ), the second one is (i 1 + i 2 , i 1 + i 2 ), and so on.For the solution i 1 , . . ., i k , the number of paths that contains corresponding k diagonal points is the product of the numbers g 1 , . . ., g k of weighted Delannoy paths ⇡ from (j 1)th diagonal point to the jth diagonal point, for j = 1, 2, . . ., k, and ⇡ does not contain any other diagonal point between these fixed ones.For the convenience, we assume that the 0th diagonal point is (0, 0).To calculate g j we observe that for every such path ⇡ we have three cases: (a) ⇡ does not go above the line y = x, (b) ⇡ does not go below the line y = x, and (c) ⇡ is a single diagonal step.Simple verification shows that g j = 2 v h S(i j 1) + d ij ,1 .
Theorem 17.We have Proof.Let us denote by g(z ).On the other hand, by (4.5) we obtain The last equality is due to g(0) = 0.The value of the central W-Delannoy number is one for n = 0, thus we can change the summation range from k 1 to k 0. Therefore, F (z) = 1/(1 g(z)) which simplifying gives the formula.
Corollary 18.For every n 0, we have Proof.By Theorem 17 we see that We use the binomial theorem and the explicit formula for [z n ]G(z) s from Theorem 15.

Counting Lattice Paths with Restrictions
Let us define three classes of segments: vertical S v (k), horizontal S h (k) and diagonal S d (k), as follows (5.2) Fix n 1.Let H 0 be the set of lattice segments obtained from S by removing r horizontal classes of segments S h (i 1 ), . . ., S h (i r ), where 0  r  n.It is clear that we can remove at most (n r) diagonal classes of segments S d (j 1 ), . . ., S d (j n r ) from the set H 0 to obtain a set H 00 such that L(n, k; H 00 ) 6 = ;.Indeed, the sets of indices I = {i 1 , . . ., i r } and J = {j 1 , . . ., j n r } can not share a common element, i.e., I \ J = ;.

A General Case of Generalized Delannoy Numbers
In previous sections we have been working under the assumption that lattice paths begin at (0, 0).To study the general case let x, y be any two lattice points, and let us denote by L[x, y] the set of all Delannoy paths from x to y.Let where x = (m, l) and y = (m + n, l + k).Denote by Likewise,  Theorem 25.For every n 0, let Then for every n 1, we have (m,l) 0 Proof.Applying (6.2) to (6.4) we obtain (m,l) 0 Solving this recurrence relation yields (6.5).
In a similar way we define generalized L-Delannoy numbers of the first and the second kind, respectively.For a given 4-tuple L = hv, h, d, ⇣i we set L 1 = h0, h, d, ⇣i and L 2 = hv, 1, 0, ⇣i.We have 
The union H [ S is a layer of the set L(n, k).Applying Lemma 29 and simplifying the formula we obtain our claim.See Fig. 9.

Connection with Partitions of Numbers
In this section we deal with the 4-tuple P = hv, 1, d, ⇣i.We follow the notation of Andrews [1].By the partition of a non-negative integer n we mean a finite nonincreasing sequence of non-negative integers ( 1 , 2 , . . ., r ) such that We define two functions on partitions.Namely, let For all n, k 1, we denote by D(m, n, k) the set of all partitions of the number n into k distinct parts from the set {0, 1, . . ., m}.We denote by R(m, n, k) the set of such partitions with repetition of their parts allowed.Then we set Let us consider the generating function of the L-Delannoy numbers of the first kind C m (z) and the second kind S m (z), respectively.Observe that Therefore, the P-Delannoy numbers of the first and second kind, respectively, are generating functions of ↵ and , in the sense that  But what do the numbers (m, n, k) really count in terms of partitions?From Corollary 9 we have where where the summation range I is given by Let H be a finite set of non-negative integers.We denote by D(H; n, k) the family of partitions of n into k distinct parts from the set H. We define R(H; n, k) similarly (repetition of parts is allowed).It is well-known that X
Proof.(a) Due to the definition of the sequence a of the 4-tuple P(H) = ha, 1, a, ⇣i, we have where the summation range ⇡ is over all subsets A ✓ H such that |A| = k.Comparing coe cients of z k we obtain (7.5a).(b) In a similar way we show the second equality, i.e., .

Examples and Remarks
In this section we present some numbers of general interest which are special cases of L-Delannoy numbers.

One shows that
z k .
Setting p = (1 + p 5)/2 and q = (1 p 5)/2 we obtain the Fibonomial coe cients [10,15,16,18,19,20] defined as ✓ n k where F n is the n-th Fibonacci number.Thus we have Due to the above correspondence, all the results from Section 6 take simple forms.For instance, Proposition 27 yields ⇢ j m j P p (n+m j)(m j) q (k+j)j ⇢ n + m j k + j P .
Corcino [7] asked about the generalization of q-Vandermonde identity for the p, qbinomials.From the above we answer to his question.
Corollary 36 (p, q-Vandermonde like identity).For n, m, k 1, we have p (m k+j) j q (k j)(n j) p (n+m j)(m j) q (k+j)j 8.3.The q-Binomial Coe cients For p = 1, we obtain the q-binomial coe cients Recall that n k q is the number of k-dimensional subspaces of the n-dimensional vector space over the finite field of order q.From Theorem 1 we have There is natural question about an analogous combinatorial interpretation of the above in terms of counting certain subspaces.The convolution (8.1) reduces to the q-Vandermonde identity [14].

Figure 4 :
Figure 4: Illustration of the bijection f from Lemma 2.
we denote S h and S d analogously.With this notation, the family S of all lattice segments (vertical, horizontal, and diagonal), is S v [ S h [ S d .Let H ✓ S, we denote by L(n, k; H) the family of all lattice paths from (0, 0) to (n, k) consisting of steps from H. Let D(n, k; H) = |L(n, k; H)|, and let G n (z; H) = X k 0 D(n, k; H)z k .(5.1)For the case H = S we have L(n, k) = L(n, k; S) and D(n, k) = D(n, k; S), and thus G n (z; S) = (1 + z) n /(1 z) n+1 .We are interested in finding the numbers D(n, k; H) for sets H which can be obtained from the whole S by removing certain classes of segments S v , S h , and S d .Proposition 19.If r 1, then for every k 0 and n r, we have S h (r) \ H = ; and S d (r) \ H = ; implies L(n, k; H) = ;.

Figure 7 :
Figure 7: Recurrence relations for the general case.
.10b)Proof.(a) To show the first equation let us consider the set L 1 (n + m, k) of lattice paths with diagonal and horizontal segments, and observe that every such path ⇡ can be "cut" at the point (n, j) into two paths ⇡ 1 and ⇡ 2 , where 0  j  k.The weight of ⇡ is the product of weights of ⇡ 1 and ⇡ 2 .See Fig.8 (a).(b)In the second equality we consider the set L 2 (n+m, k+m) of lattice paths with horizontal and vertical segments.As in (a) we can show that ⇡ 2 L 2 (n + m, k + m) can be "cut" at the point (j, m j), where 0  j  m.See Fig.8 (b).

Figure 8 :
Figure 8: Illustration of the convolution-like formulae.Let ⇡ 2 L[x, y], and let ↵ be a segment (vertical, horizontal or diagonal) of the lattice.We write ↵ 2 ⇡ if the path ⇡ contains the segment ↵.A set of segments = {↵ 1 , . . ., ↵ s } is called the layer of the set L[x, y] if for every ⇡ 2 L[x, y] there is exactly one segment ↵ i 2 such that ↵ i 2 ⇡.Denote by ⇤[x, y] the family of all layers of the set L[x, y].If x = (0, 0), then we write ⇤[y] for short.

Figure 10 :
Figure 10: A layer of L[(n, k)] used in horizontal summation.

Figure 11 :
Figure 11: A layer of L[(n, k)] used in diagonal summation.

.
For the general case of the P-Delannoy numbers we have 