Interface
#include <codecogs/maths/combinatorics/sequences/euler_triangle_row.h>
using namespace Maths::Combinatorics::Sequences;
| std::vector<int> | euler_triangle_row (int n)
Computes the row of order n in the Euler triangle. |
Use the following HTML code to embed the calculators within other websites:
Euler Triangle Row
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.
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
Returns
- the entries of the row in Euler triangle
Authors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.