Calculates the Young tableau number of the given order.

View versions (1)

Interface

#include <codecogs/maths/combinatorics/sequences/young_number.h>

using namespace Maths::Combinatorics::Sequences;

This function computes the Young tableau number of order n, using the following recurrent sequence:

Y(n) = Y(n-1) + (n-1)Y(n-2)
(1)

with initial values

Y(1) = 1 \qquad Y(2) = 2
(2)

Parameters

n
the desired order

Returns

the Young tableau number of order n

Example:

#include <codecogs/maths/combinatorics/sequences/young_number.h>
#include <iostream>
int main()
{
  std::cout << "Young tableau numbers for 0 < n < 10" << std::endl;
  for (int i = 1; i < 10; i++)
    std::cout << i << "  " << Maths::Combinatorics::Sequences::young_number(i) << std::endl;
  return 0;
}

Output:

Young tableau numbers for 0 < n < 10
1  1
2  2
3  4
4  10
5  26
6  76
7  232
8  764
9  2620

References

SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html

GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

n
Result