FUNCTION
Involution_Numbers_List
Calculates the numbers of involutions of 0 through \e n objects.
You're viewing an older version of this page (#36). View the current version.
Interface
#include <codecogs/maths/combinatorics/sequences/involution_numbers_list.h>
using namespace Maths::Combinatorics::Sequences;
This function calculates the number of involutions for 0 through n objects, using the following recurrent sequence:
(1)
An involution is a permutation consisting only of fixed points and pairwise transpositions. It can be proven that to every involution there is a unique corresponding inverse.
Example 1
#include <codecogs/maths/combinatorics/sequences/involution_numbers_list.h>
#include <iostream>
int main() {
std::vector<int> result = Maths::Combinatorics::Sequences::involution_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: 11
1 1 2 4 10 26 76 232 764 2620 9496Returns
the involution numbers of order 0 to n
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.