Skip to main content

alpha_suffix

Function alpha_suffix 

Source
pub fn alpha_suffix(n: usize) -> String
Expand description

Infinite alphabetic suffix sequence. n=0 yields the first suffix past Decillion. The sequence is grouped into phases; phase L≥0 produces all (L+2)-letter strings, first all-lowercase, then capital-first. Each phase has 2 × 26^(L+2) entries.

Concretely:

n = 0..676            → aa, ab, …, az, ba, …, zz       (676 = 26²  lowercase pairs)
n = 676..1352         → Aa, Ab, …, Az, Ba, …, Zz        (676  uppercase-first pairs)
n = 1352..1352+17576  → aaa, aab, …, zzz               (17576 = 26³  lowercase triples)
n = …  + 17576        → Aaa, Aab, …, Zzz                (uppercase-first triples)
…

Each suffix step represents three more orders of magnitude on top of 10^33 ≈ Dc, so phase 0 alone covers 10^36 … 10^(33 + 676·3) = 10^36 … 10^2061 — already past f64::MAX ≈ 1.8e308. The higher phases exist so the helper remains correct under any future arbitrary-precision number type.