GO-V.ORG
As seen in

Thue–Morse sequence

In mathematics, the Thue–Morse or Prouhet–Thue–Morse sequence is the binary sequence (an infinite sequence of s and s) that can be obtained by starting with and successively appending the Boolean complement of the sequence obtained thus far. It is sometimes called the fair share sequence because of its applications to fair division or parity sequence. The first few steps of this procedure yield the strings , , , , , and so on, which are the prefixes of the Thue–Morse sequence. The full sequence begins: : The sequence is named after Axel Thue, Marston Morse and (in its extended form). Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In mathematics, the Thue–Morse or Prouhet–Thue–Morse sequence is the binary sequence (an infinite sequence of s and s) that can be obtained by starting with and successively appending the Boolean complement of the sequence obtained thus far. It is sometimes called the fair share sequence because of its applications to fair division or parity sequence. The first few steps of this procedure yield the strings , , , , , and so on, which are the prefixes of the Thue–Morse sequence. The full sequence begins: The sequence is named after Axel Thue, Marston Morse and (in its extended form) . from typing import Iterator def generate_sequence(seq_length: int) -> Iterator[int]: """Thue–Morse sequence.""" value: int = 1 for n in range(seq_length): # Note: assumes that (-1).bit_length() gives 1 x: int = (n ^ (n - 1)).bit_length() + 1 if x & 1 == 0: # Bit index is even, so toggle value value = 1 - value yield value The resulting algorithm takes constant time to generate each sequence element, using only a logarithmic number of bits (constant number of words) of memory. t_0 &= 0,\\ t_{2n} &= t_n,\\ t_{2n+1} &= 1 - t_n, \end{align} for all non-negative integers . def thue_morse_bits(n: int) -> int: """Return an int containing the first 2**n bits of the Thue–Morse sequence, low-order bit 1st.""" bits = 0 for i in range(n): bits |= ((1 Which can then be converted to a (reversed) string as follows: n = 7 print(f"{thue_morse_bits(n):0{1 \prod_{i=0}^{\infty} \left(1 - x^{2^i}\right) = \sum_{j=0}^{\infty} (-1)^{t_j} x^j, where is the th element if we start at . [a;b,b,a,b,a,a,b,\ldots]=a+\dfrac{1}{b+\dfrac{1}{b+\dfrac{1}{a+\dfrac{1}{b+\dfrac{1}{a+\dfrac{1}{a+\dfrac{1}{b+\ddots}}}}}}}, is transcendental. \sum_{x \in S_0} x^i = \sum_{x \in S_1} x^i for all integers from to . This has a solution if is a multiple of , given by: consists of the integers in for which , consists of the integers in for which . For example, for and , The condition requiring that be a multiple of is not strictly necessary: there are some further cases for which a solution exists. However, it guarantees a stronger property: if the condition is satisfied, then the set of th powers of any set of numbers in arithmetic progression can be partitioned into two sets with equal sums. This follows directly from the expansion given by the binomial theorem applied to the binomial representing the th element of an arithmetic progression. For generalizations of the Thue–Morse sequence and the Prouhet–Tarry–Escott problem to partitions into more than two parts, see Bolker, Offner, Richman and Zara, "The Prouhet–Tarry–Escott problem and generalized Thue–Morse sequences". \sum_{n\geq1} \frac{5 t_{n-1} + 3 t_n}{n^2} &= 4 \zeta(2) = \frac{2 \pi^2}{3}, \\ \sum_{n\geq1} \frac{9 t_{n-1} + 7 t_n}{n^3} &= 8 \zeta(3),\end{align} where is the th term of the Thue–Morse sequence. In fact, for all with real part greater than , we have (2^s+1) \sum_{n\geq1} \frac{t_{n-1}}{n^s} + (2^s-1) \sum_{n\geq1} \frac{t_{n}}{n^s} = 2^s \zeta(s).

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Thue–Morse sequence". 1775596451. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1347650425

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·