Construct Tetranacci Words
Generate and analyze Tetranacci words via iterated morphism. Explore letter frequencies, growth ratios, and word structure up to any iteration depth.
| n | Length | 0's | 1's | 2's | 3's | Ratio |
|---|
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.
Formulas
The standard Tetranacci word morphism Ļ over the alphabet {0, 1, 2, 3} is defined as:
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:
The growth ratio |Wn||Wnā1| converges to the Tetranacci constant Ļ, the largest real root of:
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 n | Word Length |Wn| | Count of 0 | Count of 1 | Count of 2 | Count of 3 | Ratio |Wn| / |Wnā1| |
|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 0 | - |
| 1 | 2 | 1 | 1 | 0 | 0 | 2.0000 |
| 2 | 4 | 2 | 1 | 1 | 0 | 2.0000 |
| 3 | 8 | 4 | 2 | 1 | 1 | 2.0000 |
| 4 | 15 | 8 | 4 | 2 | 1 | 1.8750 |
| 5 | 29 | 15 | 8 | 4 | 2 | 1.9333 |
| 6 | 56 | 29 | 15 | 8 | 4 | 1.9310 |
| 7 | 108 | 56 | 29 | 15 | 8 | 1.9286 |
| 8 | 208 | 108 | 56 | 29 | 15 | 1.9259 |
| 9 | 401 | 208 | 108 | 56 | 29 | 1.9279 |
| 10 | 773 | 401 | 208 | 108 | 56 | 1.9278 |
| 11 | 1490 | 773 | 401 | 208 | 108 | 1.9276 |
| 12 | 2872 | 1490 | 773 | 401 | 208 | 1.9275 |
| 13 | 5536 | 2872 | 1490 | 773 | 401 | 1.9275 |
| 14 | 10671 | 5536 | 2872 | 1490 | 773 | 1.9275 |
| 15 | 20569 | 10671 | 5536 | 2872 | 1490 | 1.9275 |