geometor.knott.golden_string¶
Collection 5: The Golden String, Zeckendorf Base, & Wythoff / Stolarsky Arrays (KNOTT-5.1 – KNOTT-5.3).
Catalogs the Sturmian Golden String (101101011011...), lattice-cutting slope
geometry, Zeckendorf’s canonical Fibonacci numeral base, Beatty’s complementary
sequences, and Morrison’s Wythoff and Stolarsky interspersion arrays curated by
Dr. Ron Knott on fibrab.html, fibrep.html, and fibGen.html.
Functions¶
|
Generate finite Rabbit-tree / morphism words \(S_1, S_2, \dots, S_{\text{steps}}\). |
|
Compute the first |
|
Return the exact number of additions in naive recursive |
|
Construct KNOTT-5.1: Sturmian lattice-cutting line \(y = \phi x\) generating |
|
Return the unique non-consecutive Fibonacci summands of positive integer |
|
Encode non-negative integer |
|
Decode any Fibonacci-base bitstring (with rightmost column \(F_2 = 1\)) into an |
|
Construct KNOTT-5.2: Geometric Fibonacci staircase & Zeckendorf decomposition of |
|
Return Beatty's complementary Golden pair \((\lfloor n\Phi \rfloor, \lfloor n\Phi^2 \rfloor)\) for \(n \ge 1\). |
|
Compute entry |
|
Locate the unique |
|
Compute entry |
|
Construct KNOTT-5.3: Wythoff / Beatty slope rays \(y = \Phi x\) & \(y = \Phi^2 x\) and cold positions. |
Module Contents¶
- geometor.knott.golden_string.golden_string_generations(steps: int = 7) list[str]¶
Generate finite Rabbit-tree / morphism words \(S_1, S_2, \dots, S_{\text{steps}}\).
Applies the Sturmian substitution \(1 \mapsto 10,\; 0 \mapsto 1\) starting from
S_1 = '1'(equivalently \(S_k = S_{k-1} + S_{k-2}\) for \(k \ge 3\), with \(|S_k| = F_{k+1}\)).- Parameters:
steps – Number of finite generations to return (\(\ge 1\)).
- Returns:
List of finite Golden String prefixes
['1', '10', '101', '10110', ...].
- geometor.knott.golden_string.golden_string_beatty_word(length: int) str¶
Compute the first
lengthcharacters of the Golden String via exact floor differences.Uses \(d_n = \lfloor (n + 1)\phi \rfloor - \lfloor n\phi \rfloor\) for \(n = 1, 2, \dots, \text{length}\), evaluated via pure integer arithmetic
floor_linear_phi()(\(n\phi = -n + n\Phi\)).- Parameters:
length – Prefix length (\(\ge 1\)).
- Returns:
Exact binary prefix of
101101011011010110101....
- geometor.knott.golden_string.recursive_fib_additions(n: int) int¶
Return the exact number of additions in naive recursive
fib(n)(withF_1 = F_2 = 1).Cataloged on
fibrab.html#props: \(A(1) = A(2) = 0\) and \(A(n) = A(n-1) + A(n-2) + 1 = F_n - 1\) (or \(F_{n+1} - 1\) when0-indexed base casesfib(0), fib(1)are used). Here forF_1 = F_2 = 1, \(A(n) = F_n - 1\); for0-basedfib(0)=0, fib(1)=1, \(A_0(n) = F_{n+1} - 1\).- Parameters:
n – Non-negative integer index for
0-basedfib(n)(\(n \ge 1\)).- Returns:
Exact addition count \(F_{n+1} - 1\).
- geometor.knott.golden_string.construct_golden_string_cutting_model() geometor.knott.flat_geometry.GeometricCatalogResult¶
Construct KNOTT-5.1: Sturmian lattice-cutting line \(y = \phi x\) generating
10110101.Constructs ray
[O R]of exact slope \(\phi = \Phi - 1\) across vertical grid lines \(x = 1..5\) and horizontal grid lines \(y = 1..3\) ingeometor.model. Intersecting[O R]with every grid line in order of distance fromOproduces vertical crossingsV1..V5(digit1) and horizontal crossingsH1..H3(digit0) in exact sequenceV1, H1, V2, V3, H2, V4, H3, V5->10110101!- Returns:
Verified
GeometricCatalogResultforKNOTT-5.1.
- geometor.knott.golden_string.zeckendorf_summands(n: int) list[int]¶
Return the unique non-consecutive Fibonacci summands of positive integer
n.Uses Fibonacci place values \(F_2 = 1, F_3 = 2, F_4 = 3, F_5 = 5, \dots\).
- Parameters:
n – Positive integer (\(n \ge 1\)).
- Returns:
Descending list of non-adjacent Fibonacci numbers summing to
n.
- geometor.knott.golden_string.to_zeckendorf(n: int) str¶
Encode non-negative integer
ninto its canonical Zeckendorf Fibonacci-base string.Columns from right to left represent \(F_2=1, F_3=2, F_4=3, F_5=5, F_6=8, \dots\) (e.g.,
to_zeckendorf(12) == '10101'for \(8 + 3 + 1\)).- Parameters:
n – Non-negative integer.
- Returns:
11-free binary Fibonacci-base string.
- geometor.knott.golden_string.from_zeckendorf(bit_str: str) int¶
Decode any Fibonacci-base bitstring (with rightmost column \(F_2 = 1\)) into an
int.- Parameters:
bit_str – String of
'0'and'1'digits.- Returns:
Decoded non-negative integer value.
- geometor.knott.golden_string.construct_zeckendorf_staircase_model() geometor.knott.flat_geometry.GeometricCatalogResult¶
Construct KNOTT-5.2: Geometric Fibonacci staircase & Zeckendorf decomposition of
12 = 8 + 3 + 1.Constructs adjacent Fibonacci column rectangles of widths
1and exact heights \(F_2=1, F_3=2, F_4=3, F_5=5, F_6=8\) ingeometor.model, highlighting the non-adjacent columns \(F_6=8, F_4=3, F_2=1\) that compose \(12 = 10101_Z\), alongside a horizontal verification bar of total length12partitioned at8and11.- Returns:
Verified
GeometricCatalogResultforKNOTT-5.2.
- geometor.knott.golden_string.beatty_pair(n: int) tuple[int, int]¶
Return Beatty’s complementary Golden pair \((\lfloor n\Phi \rfloor, \lfloor n\Phi^2 \rfloor)\) for \(n \ge 1\).
Uses \(\lfloor n\Phi^2 \rfloor = \lfloor n(\Phi + 1) \rfloor = \lfloor n\Phi \rfloor + n\) and exact integer arithmetic
floor_linear_phi().- Parameters:
n – Positive integer (\(n \ge 1\)).
- Returns:
Exact integer pair
(floor(n * PHI), floor(n * PHI^2)).
- geometor.knott.golden_string.wythoff_entry(row: int, col: int) int¶
Compute entry
W(row, col)(0-indexed) of Morrison’s Wythoff Array.Matches Dr. Ron Knott’s formula on
fibGen.html#wythoffprops: \(W(r, c) = \lfloor (r + 1)\Phi \rfloor F_{c + 2} + r F_{c + 1}\).- Parameters:
row – Non-negative row index (\(r \ge 0\)).
col – Non-negative column index (\(c \ge 0\)).
- Returns:
Positive integer at
(row, col)in the Wythoff Array.
- geometor.knott.golden_string.wythoff_locate(n: int) tuple[int, int]¶
Locate the unique
(row, col)(0-indexed) of positive integernin the Wythoff Array.Uses the Zeckendorf trailing-zero characterization:
colequals the number of trailing'0'digits into_zeckendorf(), andW(row, 0)increases strictly withrow.- Parameters:
n – Positive integer (\(n \ge 1\)).
- Returns:
Unique
(row, col)pair satisfyingwythoff_entry(row, col) == n.
- geometor.knott.golden_string.stolarsky_entry(row: int, col: int) int¶
Compute entry
S(row, col)(0-indexed) of Kenneth Stolarsky’s (1977) Array.Matches Dr. Ron Knott’s formula on
fibGen.html#stolarsky:\(S(r, 0) = r + 1 + \lfloor (r + 1/2)\Phi \rfloor\);
\(S(r, 1) = \operatorname{round}(S(r, 0)\Phi) = \lfloor S(r, 0)\Phi + 1/2 \rfloor\);
\(S(r, c) = S(r, c - 1) + S(r, c - 2)\) for \(c \ge 2\).
- Parameters:
row – Non-negative row index (\(r \ge 0\)).
col – Non-negative column index (\(c \ge 0\)).
- Returns:
Positive integer at
(row, col)in Stolarsky’s Array.
- geometor.knott.golden_string.construct_wythoff_beatty_model() geometor.knott.flat_geometry.GeometricCatalogResult¶
Construct KNOTT-5.3: Wythoff / Beatty slope rays \(y = \Phi x\) & \(y = \Phi^2 x\) and cold positions.
Constructs the two complementary Beatty slope rays \(y = \Phi x\) and \(y = \Phi^2 x\) from
O(0,0)alongside Wythoff’s game cold positions \((\lfloor n\Phi \rfloor, \lfloor n\Phi^2 \rfloor)\) for \(n = 1..4\):W1(1,2),W2(3,5),W3(4,7),W4(6,10). Verifies exact bijective partitioning of1..100across Beatty’s pair, Wythoff’s Array, and Stolarsky’s Array.- Returns:
Verified
GeometricCatalogResultforKNOTT-5.3.