#Abstract
Positional numeral systems are taught and implemented as points on the Archimedean real line, yet the digit strings that encode integers form a rooted $b$‑ary tree. This work identifies the concrete gap that the native metric induced by digit‑string structure has never been formalized, leading to hidden assumptions about distance and clustering. We adopt the valuation framework of non‑Archimedean number theory, define the $b$‑adic valuation $v_b$, and prove that the associated distance $d_b(x,y)=b^{-v_b(x-y)}$ satisfies all ultrametric axioms for every integer base $b\ge2$. Two quantitative illustrations are derived analytically: (1) exact counts of ultrametric distances for all unordered pairs of decimal integers $0\le x\lt y\le999$, yielding $450\,000$ pairs at distance $1$, $45\,000$ at $0.1$, and $4\,500$ at $0.01$; (2) the mean $b$‑adic distance for the interval $0\le x\lt y\le99$ is $\frac{101}{110}\approx0.918$, the diameter‑normalized Euclidean mean is $\frac{101}{297}\approx0.340$, giving a ratio of exactly $2.70$, and all $855$ pairs with Euclidean distance $\le9$ are maximally distant ($d_b=1$). Recognizing the intrinsic ultrametric reshapes curricula, data‑structure design, and cryptographic primitives that rely on positional notation.
#1. Introduction
Students, educators, and software engineers all rely on positional notation to encode integers, yet the hidden cost is a persistent mismatch between the line‑based intuition taught in schools and the tree‑based reality of digit strings. When a teacher asks a class to compare 1230 and 1240, the Euclidean distance on the number line is $10$, but the trailing‑digit similarity suggests a much closer relationship: both share the three most significant digits and differ only in the last digit. This discrepancy blocks a clear understanding of hierarchical relationships among numbers, hampers the design of algorithms that could exploit digit‑wise clustering, and obscures the source of rounding errors in digital systems. If the intrinsic ultrametric structure of positional notation were recognized, designers could build tree‑oriented data structures, educators could teach number sense via digit‑tree clustering, and cryptographers could exploit the silent base parameter as a security primitive.
Contributions.
- Formal proof that digit‑string comparison in any base $b$ defines a non‑Archimedean valuation and satisfies the ultrametric axioms (Section 4).
- Exact enumeration of the ultrametric distance distribution for decimal integers $0$–$999$ (Section 5).
- Analytic computation of the mean $b$‑adic distance for decimal integers $0$–$99$, the normalized Euclidean mean, and the ratio of the two (Section 5).
- Analysis of pedagogical and engineering implications, including recommendations for curriculum redesign and data‑structure development (Section 8).
#2. Background and Related Work
The theory of valuations on local domains provides a rigorous foundation for non‑Archimedean metrics. Olalla et al. describe rank‑one valuations $\nu$ with value group $\Gamma$ and illustrate extensions to formal completions [1]. Their definition of $\mathcal{P}_\beta$ and the construction of the support ideal $H$ underpin the algebraic notion of a valuation ring, which we specialize to the $b$‑adic case.
Ultrametrics are defined by the strong triangle inequality $d(x,y)\le\max\{d(x,z),d(z,y)\}$ for all triples $(x,y,z)$ [2]. This property distinguishes ultrametric spaces from ordinary metric spaces and yields a natural tree representation of distances.
Cantor sets equipped with an ultrametric $d_u$ exhibit a hierarchical, totally disconnected topology, as shown by Datta and Raut for binary Cantor constructions [3]. Their work demonstrates that ultrametric distances correspond to the depth of a common ancestor in a rooted tree, directly analogous to trailing‑digit agreement in positional notation.
In data analysis, ultrametric embeddings are used to detect anomalies by hierarchical clustering of high‑dimensional observations [5]. The authors embed Euclidean data into an ultrametric hierarchy, emphasizing that the induced ultrametric captures structural relationships not visible in the original metric.
Matte Blanco’s symmetric‑asymmetric dichotomy is modeled via ultrametric topologies, linking hierarchical clustering of textual data to mental processes [6]. This illustrates the broad applicability of ultrametric structures beyond pure mathematics.
Epidemiological modeling extends the classical SIR framework by assigning an ultrametric distance $d(x,y)$ based on hierarchical clustering of individuals, thereby modulating infection probabilities with $1/d(x,y)$ [7]. The construction of $d$ as a ratio of observation time to cluster boundary values parallels our definition of $d_b$ as a function of trailing‑digit depth.
Valuation equations for stochastic volatility models rely on the existence of a valuation function $u$ solving a partial differential equation, highlighting the centrality of valuation concepts in quantitative finance [8]. Although the context differs, the methodological reliance on valuation theory validates the relevance of valuation‑based reasoning.
#3. Methods
We work entirely analytically. Let $b\ge2$ be an integer base. For any integer $n\neq0$, define the $b$‑adic valuation
Set $v_b(0)=\infty$. The associated distance function on $\mathbb{Z}$ is
Our method consists of three steps:
- Verification of valuation axioms. Using the definition of $v_b$ we check non‑negativity, identity of indiscernibles, symmetry, and the ultrametric strong triangle inequality, invoking the algebraic properties of divisibility.
- Tree interpretation. We map each integer to a rooted $b$‑ary tree where the path from the root records the digit string in base $b$. The distance $d_b$ equals $b^{-\ell}$ where $\ell$ is the length of the longest common suffix (trailing digits) of the two strings.
- Enumeration and mean‑distance analysis. For a finite interval $[0,N]$ with $N=b^{m}-1$ we (a) count unordered pairs attaining each possible distance $b^{-k}$ for $k=0,\dots,m-1$; (b) compute the mean $b$‑adic distance for $m=2$ (numbers $0$–$99$) and compare it to the diameter‑normalized Euclidean mean.
All derivations are performed symbolically; no empirical data are collected.
#4. Analysis
#4.1 Valuation Axioms
Non‑negativity. By definition $v_b(x-y)\in\mathbb{N}\cup\{\infty\}$, hence $b^{-v_b(x-y)}\ge0$. Identity of indiscernibles. If $x=y$ then $x-y=0$ and $v_b(0)=\infty$, so $d_b(x,y)=b^{-\infty}=0$. Conversely, if $d_b(x,y)=0$ then $b^{-v_b(x-y)}=0$, which implies $v_b(x-y)=\infty$ and thus $x=y$. Symmetry. $d_b(x,y)=b^{-v_b(x-y)}=b^{-v_b(y-x)}=d_b(y,x)$ because divisibility is symmetric. Strong triangle inequality. For any $x,y,z\in\mathbb{Z}$ let $k=v_b(x-y)$, $\ell=v_b(y-z)$, and $m=v_b(x-z)$. Since $x-z=(x-y)+(y-z)$, the highest power of $b$ dividing $x-z$ cannot exceed the maximum of the powers dividing the summands. Formally,
for some integers $a,b$. Hence $m\ge\min\{k,\ell\}$ and therefore
Thus $d_b$ satisfies the ultrametric inequality (cf. [2]).
#4.2 Tree Representation
Represent each integer $x$ in base $b$ as a digit string $(d_{m-1}\dots d_{0})$. The rooted $b$‑ary tree has depth $m$; each level corresponds to a digit position from least significant (level 0) to most significant (level $m-1$). Two integers share a common ancestor at depth $\ell$ precisely when their last $\ell$ digits coincide. Therefore the ultrametric distance is
#4.3 Counting Distances for Decimal Integers $0$–$999$
We set $b=10$ and $m=3$. The total number of unordered distinct pairs is
Pairs with $v_{10}\ge1$ (last digit equal). There are $10$ residue classes modulo 10, each containing $100$ numbers. Within each class the number of pairs is $\binom{100}{2}=4\,950$. Hence
Pairs with $v_{10}\ge2$ (last two digits equal). There are $10^{2}=100$ residue classes modulo 100, each of size $10$. Pairs per class: $\binom{10}{2}=45$. Thus
Pairs with $v_{10}\ge3$ (last three digits equal). Only identical numbers share all three digits; since we consider distinct pairs, this count is zero.
From these cumulative counts we obtain the exact numbers for each valuation level:
Corresponding ultrametric distances are $d_{10}=10^{-v_{10}}$:
#4.4 Mean‑Distance Analysis for Decimal Integers $0$–$99$
We set $b=10$ and $w=2$ (two‑digit width). The total number of unordered distinct pairs is
Ultrametric distances. Pairs with the same last digit have $v_{10}=1$ and distance $0.1$. There are $10$ residue classes modulo 10, each of size $10$, giving $\binom{10}{2}=45$ pairs per class and $10\times45=450$ such pairs. All remaining $4\,950-450=4\,500$ pairs have $v_{10}=0$ and distance $1$.
The mean $b$‑adic distance is therefore
Diameter‑normalized Euclidean distances. The Euclidean distance between two distinct integers $x\lt y$ is $y-x$. The sum of all such differences for $0\le x\lt y\le99$ is
giving $\frac{1}{6}\times100\times(10\,000-1)=166\,650$.
The diameter of the set $\{0,\dots,99\}$ is $99$. Normalizing each Euclidean distance by $99$ and averaging yields
Ratio of means.
Pairs with Euclidean distance $\le9$. For each $i\in\{0,\dots,99\}$ the number of $j\gt i$ with $j-i\le9$ is $\min(9,99-i)$. Summing yields
All these $855$ pairs have different last digits, hence $v_{10}=0$ and $d_{10}=1$, i.e. they are maximally distant in the ultrametric.
#5. Results
The analytical derivations confirm that any base‑$b$ positional system carries a canonical $b$‑adic valuation and an associated ultrametric distance satisfying all metric axioms. The concrete enumeration for decimal integers up to three digits yields exact distance frequencies (Section 4.3). The mean‑distance analysis for two‑digit decimals quantifies the divergence between the ultrametric and the Euclidean line (Section 4.4). These results demonstrate that the digit‑tree hierarchy is mathematically intrinsic, not an artifact of representation.
#Appendix C. Extended Derivations and Worked Examples
#1. General counting formula for $b$‑adic distances
Let $b\ge2$ be an integer base and let $m\ge1$ be the fixed digit width, so that the interval of interest is
The total number of unordered distinct pairs in $\mathcal{I}_{b,m}$ is
For a non‑negative integer $k\le m-1$ define the valuation level $k$ by $v_{b}(x-y)=k$, i.e. the two numbers share exactly the last $k$ digits but differ at the $(k+1)$‑st digit from the right. Pairs with $v_{b}(x-y)\ge k$ are those whose last $k$ digits coincide. There are $b^{k}$ residue classes modulo $b^{k}$, each class containing $b^{m-k}$ numbers. The number of unordered pairs inside a single class is $\binom{b^{m-k}}{2}=b^{m-k}\bigl(b^{m-k}-1\bigr)/2$. Multiplying by the $b^{k}$ classes gives the cumulative count
Similarly
The exact number of pairs with valuation exactly $k$ is the difference
Equation (4) reproduces the concrete counts for decimal three‑digit numbers given in Section 4.3:
#Example: binary four‑digit interval
Take $b=2$, $m=4$ (numbers $0\le x\le15$). Using (4):
The sum $64+32+16+8=120$ matches the total $\binom{16}{2}$ from (1). The corresponding distances are $d_{2}=2^{-k}$, i.e. $1,\,\tfrac12,\,\tfrac14,\,\tfrac18$.
#2. Asymptotic distribution
Dividing (4) by the total number of pairs (1) yields the proportion of pairs at distance $b^{-k}$:
Thus, for large $m$, the probability that two random $m$‑digit numbers are at ultrametric distance $b^{-k}$ decays geometrically with factor $1/b$ per increase of $k$.
#3. Relation to the radix‑ultrametric chain
Equation (4) formalizes the tree‑hierarchy interpretation: $N_{k}$ counts pairs whose lowest common ancestor lies at depth $k$ in the rooted $b$‑ary tree that represents the digit strings. The factor $b^{\,2m-k-1}$ reflects the number of possible ancestor nodes at that depth, while the factor $(b-1)/2$ accounts for the two distinct sub‑trees branching from each ancestor.
#4. Multiplicative scaling and valuation shift
Transposition of musical frequencies is performed by multiplying every member of a set by a single factor. In the present number‑theoretic setting, multiplying both integers $x$ and $y$ by the base $b$ adds one to the $b$‑adic valuation of their difference:
Consequently the ultrametric distance contracts by a factor $1/b$:
Equation (6) mirrors the musical transposition idea: a uniform scaling of all elements preserves the hierarchical pattern while uniformly shrinking the ultrametric distances.
#5. Comparison with binary‑tree distance in quantum registers
The tree distance defined for qubit registers in [12] is
where $n$ is the register depth and $\oplus$ denotes bitwise XOR. This distance counts the depth of the lowest common ancestor in the binary tensor‑product tree. For a register of depth $n=m$, the normalized distance $2^{-d_{T}(i,j)}$ coincides with the $2$‑adic distance $d_{2}(i,j)=2^{-v_{2}(i-j)}$ because the binary representation of $i-j$ and the XOR $i\oplus j$ share the same trailing‑zero pattern. Hence the $b$‑adic ultrametric derived in Sections 3–4 is a direct generalisation of the quantum‑register metric of [12] from the binary case ($b=2$) to arbitrary integer bases.
#6. Worked example: mean $b$‑adic distance for arbitrary base
For a fixed width $m$, the mean ultrametric distance is
Substituting (4) gives
For $b=10$, $m=2$ this reduces to
exactly the value reported in Section 4.4. Equation (7) therefore provides a closed‑form expression for any base and any digit width.
#7. Sensitivity to digit‑width truncation
Suppose the digit width is reduced from $m$ to $m-1$ while keeping the base $b$ fixed. The total number of pairs drops from $\binom{b^{m}}{2}$ to $\binom{b^{m-1}}{2}$, and the proportion of pairs at the finest non‑unit distance $b^{- (m-1)}$ changes from
to zero, because the distance $b^{-(m-1)}$ no longer exists in the shorter representation. The mean distance therefore increases when the representation is truncated, reflecting the loss of fine‑grained hierarchical information. This observation aligns with the pedagogical implication that limiting the number of displayed digits (e.g., rounding) coarsens the intrinsic ultrametric structure.
#8. Cross‑disciplinary illustration
These extended derivations deepen the analytical foundation of the $b$‑adic ultrametric, connect it to concrete examples in binary quantum registers, illustrate the effect of multiplicative scaling, and situate the results within the broader radix‑ultrametric chain identified in [9]. The closed‑form formulas (4) and (7) enable immediate computation of distance distributions for any base and digit width, supporting the practical and theoretical claims made throughout the manuscript.
#6. Discussion
#Limitations
- Finite‑range analysis. Counts and means were computed for the intervals $[0,10^{3}-1]$ and $[0,10^{2}-1]$; extending to larger ranges follows the same combinatorial pattern but was not explicitly enumerated.
- Base restriction to integers $\ge2$. The proof assumes an integer base; non‑integer or mixed‑radix systems require separate treatment.
- Absence of empirical validation. All conclusions are derived analytically; experimental verification (e.g., clustering of real‑world data using the defined ultrametric) is proposed in Section 7.
#Failure Modes
If a representation scheme modifies digit ordering (e.g., little‑endian vs big‑endian) without adjusting the definition of trailing‑digit agreement, the derived ultrametric may no longer correspond to the intended hierarchy. Additionally, if a system allows leading zeros to be omitted arbitrarily, the tree depth changes, affecting distance values.
#Falsifiability
The main claim—that the native metric of positional notation is the $b$‑adic ultrametric—would be falsified if a concrete counterexample were found where the strong triangle inequality fails for the distance $d_b$ defined above. Since the proof in Section 4.1 is purely algebraic, any such counterexample would imply an error in the definition of $v_b$ or in the divisibility argument.
#Hypothesis (derived analytically): For the interval $0\le x\lt y\le99$, the total number of unordered distinct pairs is $4\,950$, of which $450$ share the same last digit (valuation $v_{10}=1$) and the remaining $4\,500$ have valuation $0$; the ratio of the ultrametric mean distance $\bar d_{10}=101/110\approx0.918$ to the normalized Euclidean mean $\bar d_{\text{Euc}}=101/297\approx0.340$ equals $2.70$.
Open Questions
- How does the ultrametric viewpoint interact with floating‑point rounding errors in binary computers?
- Can the $b$‑adic ultrametric be leveraged to design more efficient hierarchical data structures (e.g., radix trees) with provable performance guarantees?
- What pedagogical strategies best convey the tree‑native nature of numbers to learners accustomed to line‑based intuition?
#7. Practical Implications and Engineering Pathways
#(a) Potential Users and Design Changes
- Curriculum designers could replace line‑centric number‑sense exercises with tree‑centric clustering activities, emphasizing trailing‑digit similarity.
- Software engineers may adopt ultrametric‑aware indexing for databases storing large integer keys, enabling logarithmic‑time range queries based on common suffixes.
- Cryptographers can exploit the base ambiguity of positional notation as a cryptographic primitive, as described in [11].
#(b) Technology Readiness
The present work is purely analytical and has not undergone peer review; according to NASA TRL definitions, it resides at TRL 1 (basic principles observed) and does not exceed TRL 3 (proof‑of‑concept analytical work).
#(c) Smallest Next Experiment
A minimal experiment would construct a depth‑3 radix tree (10 × 10 × 10 nodes) and measure the average lookup time for queries based on trailing‑digit similarity versus a flat hash table of the same size. The experiment would falsify the claim if the tree does not outperform the hash table in lookup speed for suffix‑based queries.
#(d) Engineering Constraints
- Data representation: Integer keys must be stored with fixed‑width digit strings to preserve trailing‑digit information.
- Compute: Algorithms need to extract trailing digits efficiently (e.g., via modulo operations) to compute ultrametric distances.
- Scalability: Tree depth grows logarithmically with the magnitude of numbers; for very large integers, memory overhead for explicit tree nodes may become a constraint.
#(e) Projected Performance Bounds
Assuming a fixed‑width $m$‑digit decimal key, the worst‑case ultrametric distance is $1$ and the finest non‑zero resolution is $10^{-m}$. For $m=6$ (numbers up to one million), the finest resolution is $10^{-6}$. These bounds follow directly from the definition of $d_{10}$ and the combinatorial counts in Sections 4.3 and 4.4.
#(f) Risks and Misuse
If the ultrametric structure is misapplied to contexts where Euclidean distance is essential (e.g., physical measurements), it could lead to incorrect interpretations. Moreover, cryptographic schemes based on secret bases must guard against side‑channel leakage of base information.
#8. Conclusion
We have shown that positional notation inherently defines a $b$‑adic valuation and an associated ultrametric distance, providing a mathematically rigorous tree‑native metric for integers. The strong triangle inequality holds for all bases, and exact distance distributions for decimal intervals up to three digits have been enumerated. Analytic computation of mean distances for two‑digit decimals quantifies the divergence from the Euclidean line. Recognizing this intrinsic ultrametric reshapes our understanding of number representation, with implications for education, data structures, and cryptography. Future work should explore algorithmic exploitation of the ultrametric hierarchy and empirical validation in real‑world systems.
#Provenance and AI Involvement
- This paper was drafted, reconciled, reviewed, revised and checked by the QNFO automated research pipeline (qnfo-research-exec 0.28.1-proportionate-notice). Language models were tools in that process; they are not authors. The named author is accountable for the content.
- Models: drafting by openai/gpt-oss-120b, zai-org/glm-5.3-flash; reconciliation, completion, review, revision and verification by openai/gpt-oss-120b, zai-org/glm-5.3-flash, moonshotai/kimi-k2.6, with the QNFO model router as a fallback.
- Sources: every reference is drawn from a bibliography retrieved from arXiv and the QNFO corpus before drafting; every cited work's full text was retrieved (arXiv HTML, or the QNFO paper's body) and the writers were given excerpts of its own sections; statements about a cited work are restricted to its retrieved title, abstract and those excerpts.
- Checks passed before publication: required sections present and finished, cross-references resolve, reference list rendered from the retrieved bibliography, no assistant residue or placeholders, adversarial model review with its blocking findings resolved, and a citation existence check at publication.
- Independent recomputation: a separately generated script recomputed 16 quantitative claims from the paper's stated inputs; 0 differed from the stated value at the stated precision.
- Not checked: whether each cited source supports the sentence that cites it beyond the retrieved full-text excerpts; derivation steps other than the recomputed claims. This paper has not been peer reviewed, and this version was published by the pipeline without a prior manual review by the author.
#References
[1] Extending valuations to formal completions. arXiv:1211.0398v1. https://arxiv.org/abs/1211.0398v1 [2] An embedding, an extension, and an interpolation of ultrametrics. arXiv:2008.10209v2. https://arxiv.org/abs/2008.10209v2 [3] Ultrametric Cantor Sets and Growth of Measure. arXiv:1002.3951v4. https://arxiv.org/abs/1002.3951v4 [5] From Data to the p-Adic or Ultrametric Model. arXiv:0809.0492v1. https://arxiv.org/abs/0809.0492v1 [6] Ultrametric Model of Mind, I: Review. arXiv:1201.2711v3. https://arxiv.org/abs/1201.2711v3 [7] Toward ultrametric modeling of the epidemic spread. arXiv:2005.08761v3. https://arxiv.org/abs/2005.08761v3 [8] Valuation equations for stochastic volatility models. arXiv:1004.3299v4. https://arxiv.org/abs/1004.3299v4 [9] https://papers.qnfo.org/papers/radix-to-ultrametrics-to-page-wootters-to-wheeler-dewitt-to. QNFO: Radix to Ultrametrics to Page-Wootters to Wheeler-DeWitt to Bruhat-Tits: A Convergent Synthesis. [11] https://papers.qnfo.org/papers/silent-radix-synthesis. QNFO: Silent-Radix Cryptography: Exploiting the Base Ambiguity of Positional Notation as a Cryptographic Primitive. [12] https://papers.qnfo.org/papers/ultrametric-quantum. QNFO: Qudit Quantum Error Correction.
#Appendix A. Divergence report
- The claim that the $b$‑adic valuation $v_b$ is multiplicative if and only if $b$ is prime (with the counterexample $2\times5=10$ in base 10) appeared only in draft b and lacked a supporting citation. It was therefore omitted from the reconciled manuscript.
#Appendix B. Claim attribution
| Claim ID | Source Draft(s) | Agreement |
|---|---|---|
| C1 | A, B | CONVERGENT |
| C2 | A, B | CONVERGENT |
| C3 | A, B | CONVERGENT |
| C4 | A, B | CONVERGENT |
| C5 | A, B | CONVERGENT |
| C6 | A, B | CONVERGENT |
| C7 | A, B | CONVERGENT |
| C8 | A, B | CONVERGENT |
| C9 | A, B | CONVERGENT |
| C10 | A, B | CONVERGENT |
| C11 | A, B | CONVERGENT |
| C12 | A, B | CONVERGENT |
| C13 | A, B | CONVERGENT |
| C14 | A, B | CONVERGENT |
| C15 | A, B | CONVERGENT |
| C16 | A, B | CONVERGENT |
| C17 | A, B | CONVERGENT |
| C18 | A, B | CONVERGENT |
| C19 | A, B | CONVERGENT |
| C20 | A, B | CONVERGENT |
Spotted a typo or a possible error? Select the passage and choose Report, or .