FUNCTION
Euler_Triangle_Row
Computes the row of order \e n in the Euler triangle.
Interface
#include <codecogs/maths/combinatorics/sequences/euler_triangle_row.h>
using namespace Maths::Combinatorics::Sequences;
The value in the n-th row and k-th column of the Euler triangular matrix equals the number of permutations of the n digits that have exactly k <em> ascents </em>, that is, k places where the i-th digit is less than the <em>(i+1)</em>-th digit.
Returns
the entries of the row in Euler triangle
Example:
#include <codecogs/maths/combinatorics/sequences/euler_triangle_row.h>
#include <iostream>
int main() {
std::vector<int> row = Maths::Combinatorics::Sequences::euler_triangle_row(9);
std::cout << "Size of row: " << row.size() << std::endl;
for (int i = 0; i < row.size(); i++)
std::cout << row[i] << " ";
std::cout << std::endl;
return 0;
}
Output:
Size of row: 9
1 502 14608 88234 156190 88234 14608 502 1
References
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.