User Rating 0.0 ā˜…ā˜…ā˜…ā˜…ā˜…
Total Usage 0 times
0 – 25
Symbols from {0, 1, 2, 3}
Is this tool helpful?

Your feedback helps us improve.

ā˜… ā˜… ā˜… ā˜… ā˜…

About

Tetranacci words extend the Fibonacci word construction to a 4-letter alphabet via iterated morphism. The substitution rules σ(0) = 01, σ(1) = 02, σ(2) = 03, σ(3) = 0 produce words whose lengths follow the Tetranacci recurrence T(n) = T(nāˆ’1) + T(nāˆ’2) + T(nāˆ’3) + T(nāˆ’4). Getting the morphism wrong collapses the word into a trivial periodic sequence, destroying the aperiodic, self-similar structure that makes these objects useful in tiling theory and quasicrystal modeling. This tool applies the exact substitution and reports frequencies, length growth, and ratio convergence toward the Tetranacci constant Ļ„ 1.9275.

The tool supports both the standard Rauzy-type morphism and a custom morphism mode where you define your own substitution rules over a 4-symbol alphabet. Note: iteration depth beyond 15 produces words exceeding 104 characters. The tool truncates display but computes full statistics. All computations run locally in your browser with no server dependency.

tetranacci morphism combinatorics on words substitution system fibonacci generalization word construction

Formulas

The standard Tetranacci word morphism σ over the alphabet {0, 1, 2, 3} is defined as:

{
σ(0) = 01σ(1) = 02σ(2) = 03σ(3) = 0

Starting from the axiom W0 = 0, each iteration applies the morphism to every symbol in the current word: Wn+1 = σ(Wn). The length follows the Tetranacci recurrence:

|Wn| = |Wnāˆ’1| + |Wnāˆ’2| + |Wnāˆ’3| + |Wnāˆ’4|

The growth ratio |Wn||Wnāˆ’1| converges to the Tetranacci constant Ļ„, the largest real root of:

x4 āˆ’ x3 āˆ’ x2 āˆ’ x āˆ’ 1 = 0

where τ 1.92756197548292. The letter frequency of symbol 0 converges to 1τ 0.5188, symbol 1 to 1τ2 0.2692, symbol 2 to 1τ3 0.1396, and symbol 3 to 1τ4 0.0724.

Where σ = morphism function, Wn = word at iteration n, Ļ„ = Tetranacci constant, |Wn| = length of word at iteration n.

Reference Data

Iteration nWord Length |Wn|Count of 0Count of 1Count of 2Count of 3Ratio |Wn| / |Wnāˆ’1|
011000 -
1211002.0000
2421102.0000
3842112.0000
41584211.8750
529158421.9333
6562915841.9310
710856291581.9286
82081085629151.9259
940120810856291.9279
10773401208108561.9278
1114907734012081081.9276
12287214907734012081.9275
135536287214907734011.9275
14106715536287214907731.9275
1520569106715536287214901.9275

Frequently Asked Questions

The Fibonacci word uses a 2-symbol alphabet {0, 1} with rules σ(0) = 01, σ(1) = 0. The Tetranacci word extends this to a 4-symbol alphabet {0, 1, 2, 3} with rules σ(0) = 01, σ(1) = 02, σ(2) = 03, σ(3) = 0. The Fibonacci word length follows F(n) = F(nāˆ’1) + F(nāˆ’2) converging to the golden ratio φ ā‰ˆ 1.618, while the Tetranacci word follows T(n) = T(nāˆ’1) + T(nāˆ’2) + T(nāˆ’3) + T(nāˆ’4) converging to Ļ„ ā‰ˆ 1.9276. Both produce aperiodic, uniformly recurrent infinite words, but the Tetranacci word has richer combinatorial complexity.
The ratio converges to the Tetranacci constant Ļ„, the dominant root of x⁓ āˆ’ x³ āˆ’ x² āˆ’ x āˆ’ 1 = 0. Early iterations show ratio = 2.0 because the initial words are too short for the recurrence to stabilize. By iteration 8-10, the ratio settles to Ļ„ ā‰ˆ 1.92756. The value is strictly less than 2 because symbol 3 maps to a single character (0) rather than a pair, breaking the doubling symmetry.
A non-primitive morphism (one whose incidence matrix has no power with all positive entries) may produce a word that does not visit all symbols after sufficient iterations. The tool will still compute the substitution correctly, but frequency convergence may fail. Some symbols may vanish entirely. The statistics panel will show zero counts for extinct symbols. For meaningful Tetranacci-like behavior, ensure every symbol eventually produces every other symbol through some chain of substitutions.
Word length grows roughly as τⁿ. At iteration 15, the word has approximately 20,569 characters. At iteration 20, it exceeds 750,000 characters. At iteration 25, it surpasses 27 million. This tool caps display at 10,000 characters but computes full statistics for any generated length. Memory usage is the binding constraint: each character occupies roughly 2 bytes in JavaScript strings, so iteration 25 requires about 54 MB of string data alone.
Yes. Just as the Fibonacci word encodes the cutting sequence of a line with slope 1/φ through a square lattice (producing Penrose-like 1D tilings), the Tetranacci word encodes analogous structures in higher-dimensional cut-and-project schemes. The word's aperiodicity and uniform recurrence make it a model for 1D quasicrystalline structures with 4-fold combinatorial complexity. The substitution matrix eigenvalues determine the scaling properties of the associated Rauzy fractal in ā„Ā³.
Yes. The incidence matrix M of the morphism σ has entries M(i,j) = number of times symbol j appears in σ(i). For the standard Tetranacci morphism, M = [[1,1,0,0],[1,0,1,0],[1,0,0,1],[1,0,0,0]]. The left eigenvector of M corresponding to the dominant eigenvalue Ļ„ gives the asymptotic letter frequencies directly. For the standard morphism, these are proportional to (1, 1/Ļ„, 1/τ², 1/τ³), normalized to sum to 1.