Narayana Number Calculator

Count the structures with n parts and k peaks from binomial coefficients, with the Catalan total alongside.

Math and PercentUpdated 2026-11-182 min read
Narayana Number Calculator
A whole number from 1 to 60.
A whole number from 1 through n.
Narayana number N(n, k)
...
Catalan number C(n)...
Mirror check...

What it does

The Narayana numbers split a Catalan total into finer groups. Where the Catalan number C(n) counts certain structures of size n all at once, N(n, k) counts only those with exactly k peaks, or equivalently k specified features such as runs of ones in a binary string.

The numbers are named after the Indian mathematician T. V. Narayana, who studied combinatorial families connected with lattices and partitions. The array is often called the Catalan triangle because its rows add up to the Catalan numbers.

The formula uses two binomial coefficients. N(n, k) equals the product of C(n - 1, k - 1) and C(n, k - 1), divided by k. That division is always exact, and the tool checks it before returning a result so a malformed calculation can never slip through.

This page also reports the Catalan number for the same n and a mirror check. The Catalan value is the sum of the whole row, giving a quick way to verify that the individual entries fit together, and the mirror check confirms the symmetry N(n, k) equals N(n, n - k + 1).

The input limit is 60. Binomial values at that size are large but well within exact integer arithmetic, and every digit of the result is printed.

How to use

  1. Enter the size n from 1 to 60.
  2. Enter the peak count k from 1 through n.
  3. Read N(n, k) from the main result box.
  4. Check the Catalan total shown beside it.
  5. Read the mirror check to confirm row symmetry.
  6. The defaults n = 5 and k = 2 reproduce the worked example.

Formula

N(n, k) = C(n - 1, k - 1) x C(n, k - 1) / k
n
The size of the structure being counted.
k
The number of peaks or distinguished features.
C(a, b)
A binomial coefficient, read as a choose b.

The Catalan number for the row is C(2n, n) divided by n plus one. Because the division in the Narayana formula is exact for all valid k, the result is always an integer. Values with k outside the range from one to n are rejected before the calculation runs.

Worked example

Example: N(5, 2)

The page opens with n = 5 and k = 2.

  1. Write the formula: N(5, 2) = C(4, 1) x C(5, 1) / 2.
  2. Compute C(4, 1) = 4.
  3. Compute C(5, 1) = 5.
  4. Multiply to get 20, then divide by 2 to get 10.
  5. The tool reports 10 as the Narayana number.
  6. The Catalan number is C(10, 5) / 6 = 252 / 6 = 42.
  7. The row for n = 5 is 1, 10, 20, 10, 1 and adds to 42.

Reference table

Narayana rows for small n
nk = 1k = 2k = 3k = 4k = 5Catalan total
2110002
3131005
41661014
51102010142

Limits

  • k must lie between 1 and n inclusive.
  • Inputs above 60 are rejected to keep the output readable.
  • The tool returns counts but does not draw the underlying paths or trees.
  • The Catalan total is computed independently, not by summing the row on screen.

Common mistakes

  • Using C(n, k) where the formula calls for C(n, k minus 1).
  • Forgetting to divide by k at the end.
  • Treating the row total as two to the power n instead of the Catalan number.
  • Assuming the array stops being symmetric for larger n.
  • Entering k equal to zero, which is outside the definition used here.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is N(5, 3)?

N(5, 3) = C(4, 2) x C(5, 2) / 3 = 6 x 10 / 3 = 20.

What is N(4, 2)?

N(4, 2) = C(3, 1) x C(4, 1) / 2 = 3 x 4 / 2 = 6.

What does the row for n = 5 add to?

1 + 10 + 20 + 10 + 1 = 42, the Catalan number C(5).

Questions

What does Narayana refine?

It refines the Catalan numbers by counting only structures with a fixed number of peaks.

Is the division by k always exact?

Yes for every valid pair of n and k, and the tool verifies this before returning an answer.

Why is the row symmetric?

Because N(n, k) equals N(n, n minus k plus one), which the mirror check confirms.

How do I get the Catalan total?

Add every entry in the row, or use the Catalan value printed beside the result.

Are large values exact?

Yes. All binomial work uses integer arithmetic with no floating point rounding.

What input range works here?

n from 1 to 60 and k from 1 through n, with clear errors outside those limits.

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.