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 0.37
sub units 0.00
+
0

Schroeder Numbers List

Computes the first \e n values of the Schroeder sequence.
Controller: CodeCogs

get GPL add to cart

Interface

C++

Schroeder Numbers List

 
std::vector<int>schroeder_numbers_listintn )
This function generates an array with the first n values in the Schroeder sequence, given by the following recurrent formula

with initial values

The Schroeder sequence is also defined by

where P(n)(X) is the Legendre polynomial of order n.

Example:

#include <codecogs/maths/combinatorics/sequences/schroeder_numbers_list.h>
#include <iostream>
int main() {
  std::vector<int> result = Maths::Combinatorics::Sequences::schroeder_numbers_list(10);
  std::cout << "Number of values: " << result.size() << std::endl;
  for (int i = 0; i < result.size(); i++)
    std::cout << result[i] << "  ";
  std::cout << std::endl;
  return 0;
}

Output:

Number of values: 10
1  1  3  11  45  197  903  4279  20793  103049

References:

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

Returns

an array of the first n values in the Schroeder sequence

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.