I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 1.04
sub units 0.00
+
0

Euler Triangle Row

Computes the row of order \e n in the Euler triangle.
Controller: CodeCogs

get GPL add to cart

Interface

C++

Euler Triangle Row

 
std::vector<int>euler_triangle_rowintn )
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.