Delannoy Number Calculator

Count lattice paths from one corner to another using right, up and diagonal steps, with the mirror check.

Math and PercentUpdated 2026-11-182 min read
Delannoy Number Calculator
A whole number from 0 to 100.
A whole number from 0 to 100.
Delannoy number D(m, n)
...
Swapped value D(n, m)...
Symmetry check...

What it does

A Delannoy number counts the ways to walk from the corner of a rectangular grid to the opposite corner when three moves are allowed: one step right, one step up, or one step diagonally up and right. With only the first two moves the answer would be a binomial coefficient, and the diagonal move is what makes the count larger.

The numbers are named after Henri Delannoy, a French mathematician who studied paths on a chessboard. They appear in combinatorics, in the theory of special functions and in the study of polyominoes, and the diagonal entries are the central Delannoy numbers.

The recurrence is easy to picture. To reach a point, the last move must have come from the point to the left, below, or diagonally below and left. Each predecessor contributes one class of paths, so the three counts add.

This page fills a small grid of values with exact integer arithmetic and reports D(m, n) together with the swapped value D(n, m). The symmetry check confirms the expected equality, since the geometry does not prefer horizontal over vertical.

Both dimensions are limited to 100, which keeps the grid small and the printed integer readable while still illustrating the growth of the array.

How to use

  1. Enter the column count m from 0 to 100.
  2. Enter the row count n from 0 to 100.
  3. Read D(m, n) from the main result box.
  4. Check the swapped value beside it for symmetry.
  5. The defaults m = 2 and n = 3 reproduce the worked example.
  6. Try m = 4 and n = 4 to see the central Delannoy value 321.

Formula

D(m, n) = D(m - 1, n) + D(m, n - 1) + D(m - 1, n - 1), with D(0, k) = D(k, 0) = 1
m
The number of rightward steps needed.
n
The number of upward steps needed.
D(m, n)
The number of paths using right, up and diagonal steps.

The boundary values are all one because reaching a point on an axis requires a single kind of step repeated. The recurrence follows by looking at the last move into a cell. The array is symmetric because a path can be reflected across the main diagonal, swapping right and up moves while leaving diagonal moves unchanged.

Worked example

Example: D(2, 3)

The page opens with m = 2 and n = 3.

  1. Fill the boundary: every D(0, k) and D(k, 0) is 1.
  2. Compute D(1, 1) = 1 + 1 + 1 = 3.
  3. Compute D(1, 2) = D(0, 2) + D(1, 1) + D(0, 1) = 1 + 3 + 1 = 5.
  4. Compute D(2, 2) = D(1, 2) + D(2, 1) + D(1, 1) = 5 + 5 + 3 = 13.
  5. Compute D(1, 3) = 1 + 5 + 1 = 7.
  6. Compute D(2, 3) = D(1, 3) + D(2, 2) + D(1, 2) = 7 + 13 + 5 = 25.
  7. The tool reports 25, swapped value 25, and a matching symmetry check.

Reference table

Delannoy numbers for small grids
mnD(m, n)Swapped
0011
1133
2155
221313
232525
336363
44321321

Limits

  • Both dimensions are limited to 100 to keep the grid small.
  • Only the three standard step types are allowed.
  • The tool returns a count, not a list of paths.
  • Weighted or restricted Delannoy variants are not covered.

Common mistakes

  • Leaving out the diagonal step, which gives a binomial coefficient instead.
  • Setting the boundary values to zero rather than one.
  • Forgetting the diagonal predecessor in the recurrence.
  • Assuming the array stops being symmetric for larger grids.
  • Confusing central Delannoy numbers with the full array.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is D(2, 3)?

D(2, 3) = 7 + 13 + 5 = 25.

What is D(1, 1)?

D(1, 1) = 1 + 1 + 1 = 3.

What is the central value D(4, 4)?

D(4, 4) = 321.

Questions

What does a Delannoy number count?

Paths from one corner of a grid to the opposite corner using right, up and diagonal steps.

Why is the array symmetric?

Reflecting a path across the main diagonal swaps horizontal and vertical steps and preserves diagonal steps.

What are central Delannoy numbers?

The diagonal entries D(n, n), beginning 1, 3, 13, 63 and 321.

How does this differ from binomial paths?

Binomial paths allow only right and up steps, so they omit the diagonal contribution.

Are the values exact?

Yes. The recurrence uses integer addition only.

What grid sizes are accepted?

Both dimensions from 0 through 100.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.