Morse Thue Number
Calculates the Morse-Thue number of the given order.
Controller: CodeCogs
Interface
C++
Excel
Morse Thue Number
intmorse_thue_number( | int | n | ) |
Example:
#include <codecogs/maths/combinatorics/sequences/morse_thue_number.h> #include <iostream> int main() { std::cout << "The first 10 terms of the Morse-Thue sequence" << std::endl; for (int i = 0; i < 10; i++) std::cout << Maths::Combinatorics::Sequences::morse_thue_number(i) << " "; std::cout << std::endl; return 0; }
Output:
The first 10 terms of the Morse-Thue sequence 0 1 1 0 1 0 0 1 1 0
References:
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.htmlParameters
n the desired order
Returns
- the Morse-Thue number of order n
Authors
- Lucian Bentea (August 2005)
Source Code
Source code is available when you buy a Commercial licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.