Submitted:
10 November 2026
Posted:
11 November 2026
You are already at the latest version
Abstract
We discuss the relation between p–adic numbers and kernels in view of a recent large deviation theory for mean-field spin glasses. As an application we show several fundamental properties of numerical bases in kernel language. In particular, we show that Derrida’s Generalized Random Energy Model can be interpreted as a (random) numerical base. We also show an application to the Primon gas and the Riemann Zeta Function by constructing a kernel representation of the Primon gas based on a finite p−base, thereby establishing a concrete link between number theory and kernel theory.
Keywords:
prime numbers
; p-adic norm
; replica symmetry breaking
In what follows we review the discoveries of Parisi, Sourlas [1] and Avetisov, et al. [2] on the relations between p–adic numbers [3,4,5] and the Replica Symmetry Breaking (RSB) theory [6] in the light of a recently introduced kernel method [7,8,9,10,11,12].
Our main result will be to apply the known links between kernels and RSB [7,8,9] and between RSB and number theory [13,14,15] to deduce a kernel representation for the p–adic numbers, and link number theory with the kernel theory described in [7,8].
In particular, we show that the Generalized Random Energy Model, (GREM) [16,17], although being random, constitutes a legitimate bijective map for any numerable set of consecutive integers. Finally, we explore the connection with the Riemann Zeta Function (RZF) [18,19,20,21,22,23,24] by applying our findings to a classic result by Spector and Julia [25,26]
1. Binary Numbers and Kernels
Let be a natural number, and let
be the ordered set of the first n nonnegative integers. Then let us introduce the notation for the generic N-digit number in the binary base
where is the th binary digit. For example, the number 10 in decimal notation is written as 1010; we say that . There is a map between the above patterns and the natural numbers m from 0 up to
It is easy to obtain a correspondence of with the spin systems by taking for any . The map from to m is simply given by the following formula:
from which we could write the first natural numbers. We can arrange the possible choices of the vector as the columns of some array, with N rows and columns: hereafter, we will call kernel such an array, see Figure 1. This object can be related to probability measures, operators and graphs (it is a graphon) [7,8,9,10,11,12]. Also, we could define a kernel rescaled by , which is shown in Figure 2. In Figure 3 we show a schematic reversal of the hierarchical weights, inspired by the formal continuation discussed in [1].
2. Extension to Adic Numbers
Now we generalize to adic numbers, where we assume p to be a prime number. The number is represented by the pattern
where is the th adic digit. Also in this case there is a bijective map between the above patterns and the natural numbers from 0 to
The map from to m is
from which we can write the first natural numbers. The tree hierarchy is identified with the adic distance by reversing the order of the digits relative to Eq. (9), as in [1]. For distinct patterns, this gives
where is the number of consecutive congruent digits, starting from (ultrametric index, see [7,8,9]). Let be the indicator function of the event X; it equals one if the event occurs and zero otherwise. Then
It has been noted in [1] that, since the adic norm is ultrametric, it can be used to describe the RSB ansatz. Together with the map defined above, this suggests that there is convenience in interpreting numbers as patterns on a tree, whose branching ratio is taken here as the fixed base p.
3. Example: Random Energy Model
We can actually build a representation for where the map is random: for simplicity we discuss this extension starting from the binary base only (i.e., dyadic base ). Given we introduce a generalized map
where we call the th generalized binary digit. For example, we recover the binary system by choosing and (see Figure 4 and 5). In general, we expect that starting from any set of such that
for any it is possible to produce a bijective map to the first naturals (eventually this can be extended to any kernel parametrization). Now, what if we chose a random base system? For two distinct patterns, the common terms cancel and the difference of their images is a nondegenerate Gaussian, so coincidences have probability zero. Then,
actually admits a valid reconstruction map
almost surely for each instance of the disorder. In the above expression are independent Gaussian random variables, one for each , centered on 0 and of variance . The noise has then the following covariance matrix
where is the indicator function of the event X (that is one if X is verified and zero otherwise). The mapping is random and noise dependent
and it is possible to recognize that this map is exactly the Hamiltonian of the Generalized Random Energy Model (GREM) [16,17]. The interesting feature of this base is that the averaged product of two numbers is equal to the overlap; most importantly, the product matrix is ultrametric. In fact
then, taking the expectation,
and if , i.e., if we take
in distribution with centered at zero with variance , then
so that the matrix of the averaged products is ultrametric, see Figure 6.
Figure 4.
Base kernel A. The kernel is subdivided into zones organized according to a tree-indexed partition; is shown. For each index vector there is a corresponding value . If we take with independent Gaussians of mean zero and variance , the resulting kernel is ultrametric (the scalar products of the columns are ultrametric on average).
Figure 4.
Base kernel A. The kernel is subdivided into zones organized according to a tree-indexed partition; is shown. For each index vector there is a corresponding value . If we take with independent Gaussians of mean zero and variance , the resulting kernel is ultrametric (the scalar products of the columns are ultrametric on average).

Figure 5.
Choosing gives the binary numbering back. The pattern in the previous figure is the number .
Figure 5.
Choosing gives the binary numbering back. The pattern in the previous figure is the number .

Figure 6.
Numbers in binary notation , , . The first two overlap in the first two digits. Then, both overlap with the third in the first digit only. If we take to be independent Gaussian random variables, the table of averaged products between two generic numbers is exactly the expected, unnormalized scalar-product matrix of the kernel columns (overlap matrix), which is also ultrametric if we take in distribution.
Figure 6.
Numbers in binary notation , , . The first two overlap in the first two digits. Then, both overlap with the third in the first digit only. If we take to be independent Gaussian random variables, the table of averaged products between two generic numbers is exactly the expected, unnormalized scalar-product matrix of the kernel columns (overlap matrix), which is also ultrametric if we take in distribution.

4. Canonical Representation
From there we can further generalize by introducing a variable base numbering, where the base is an dimensional prime vector . For a vector base
the number of distinct numbers that we can write in such a base is
Let the product of the prime sub-spaces
be the space of digit numbers in base
where the th digit in the base is
Let us define the partial products and
There is a map to the numbers m from 0 up to
5. Fundamental Theorem of Arithmetic
The fundamental theorem of Arithmetic guarantees that each positive integer admits a decomposition into primes, i.e., a canonical representation, that is unique up to commutations of factors in the product. Let be the set of prime numbers,
where is the multiplicity of the factor p (that can be zero if p is not a factor of n). We call the vector
the prime spectrum of n, which is unique for each n. We define the prime support of n
that is the set of prime factors of n.
For each n we can associate a –base, which we indicate with , with branching ratios given by the prime factors of n and multiplicities given by the spectrum . Consider the moments of the prime spectrum of n
with . For , this quantity equals the number of prime factors of n, counted with multiplicity, and will be interpreted as the total number of bosons
while for one gets the number of prime divisors of n
that can be identified with the number of types of bosons necessary to get an excitation of energy .
6. Example: Primon Gas
We conclude by recalling a physical interpretation of the Riemann Zeta Function (RZF) due to Spector and Julia, [25,26], the so-called “Primon” gas. In this work, we extend this picture by constructing a kernel representation of the Primon gas based on a finite p-base, providing a concrete numerical framework for its spectrum. Let be a positive integer and let be the set of prime numbers. Since prime numbers are numerable we can keep the label ℓ to control the set ; we denote by the th prime number according to the chosen index. We consider an index where the primes are ordered in increasing size, . By the fundamental theorem of arithmetic, there is only one spectrum associated to n such that
Writing , we obtain
For , the canonical partition function of such a Hamiltonian is the Riemann Zeta Function (RZF); this can be shown analytically
but notice that the same result is obtained by physical arguments if one assumes that the Hamiltonian represents a mixture of non-interacting bosons
The boson types are labeled by ℓ and represent the prime numbers; each is then interpreted as an excitation of this gas with spectrum , that is the prime spectrum of n. In the second line of the above equation we sum over all possible values of the prime spectrum , which are interpreted as occupation numbers of the th boson type. One can associate a free energy to such a gas
and the relative Gibbs measure, that is
which represents the probability of finding an excitation with spectrum in a Primon gas at temperature . This is interesting because we can quantify the probability mass outside the first n energy levels, and find that it decays both in n and in the inverse temperature . By combining this with the argument of the previous sections we can actually construct a kernel representation of the Primon gas that accounts for a large portion of the equilibrium ensemble. For , consider a truncated spectrum
containing only the first L primes. By definition, with the first L primes we can write any number smaller than the th prime. Let us introduce a notation for the maximum of each component with respect to the condition
Then we could use to construct a common kernel base for any integer less than without gaps. This is obtained by interpreting the th component of the bound as the multiplicity of adic digits associated to the prime in a –base with
digits in total. We can bound the spectrum as follows
and still represent the first positive integers, together with zero, without any gap, since the bound was chosen such that the missing integers are greater than or equal to . Hence, the mixed-base numbering agrees with the integers admitted by the bounded prime spectrum throughout the regular set below the first gap. Starting at the first gap, this correspondence is no longer guaranteed (Figure 7). This modified spectrum describes an approximate Primon gas where some (in fact most) energy levels labeled by integers larger than are neglected: this is closely related to the “regular set” described in [7,8,29]. By Equation (44), the Gibbs probability of the region where the representations may differ satisfies
This bound vanishes as the number of retained primes increases at fixed temperature, or as the temperature decreases at fixed truncation, thereby controlling the Gibbs mass associated with the discrepancy. Further investigations will be presented elsewhere.
7. Conclusions
We have shown that p–adic theory, Replica Symmetry Breaking, and kernel methods share a common formal structure. The generalization to the mixed base allows any natural number to be represented as a hierarchical spin state, while the construction of a base for the Primon gas provides a concrete and controlled kernel realization of the Riemann Zeta function. This result makes the connection between number theory and kernel theory explicit and operational, offering a novel framework to investigate arithmetic models through ultrametric and kernel-based approaches. The kernel-based approach also provides a direct connection to the statistical mechanics of networks, including Boltzmann machines and the perceptron [30,31], and to the recently developed lattice field theory approach to natural neural networks [11,12,32].
Acknowledgments
The research presented in this work was conducted in the period 2016–2020 within the LoTGlasSy project (Parisi), funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (Grant Agreement Num. 694925). We are grateful to Giorgio Parisi (Accademia dei Lincei), Filippo Cesi (Sapienza Università di Roma) and Nicola Kistler (Goethe University Frankfurt) for interesting discussions.
References
- Parisi, G.; Sourlas, N. P-adic numbers and replica symmetry breaking. Eur. Phys. J. B 2000, 14, 535–542. [Google Scholar] [CrossRef]
- Avetisov, V. A.; Bikulov, A. H.; S. V. Kozyrev, J. Application of p-adic analysis to models of breaking of replica symmetry. Phys. A Math. Gen. 1999, 32, 8785. [Google Scholar] [CrossRef]
- Khrennikov, A. P-Adic Valued Distributions in Mathematical Physics; Springer Dordrecht, 1994. [Google Scholar]
- Aniello, P.; Mancini, S.; Parisi, V. A p–Adic Model of Quantum States and the p–Adic Qubit. Entropy 2023, 25(1), 86. [Google Scholar] [CrossRef] [PubMed]
- Zuniga-Galindo, W. A. P-adic statistical field theory and deep belief networks. Physica A Stat. Mech. Its Appl. 2023, 612, 128492. [Google Scholar] [CrossRef]
- Mezard, M.; Parisi, G.; Virasoro, M. A. Spin Glass theory and Beyond; World Scientific, 1987. [Google Scholar]
- Franchini, S. Replica Symmetry Breaking without Replicas. Ann. Phys. 2023, 450, 169220. [Google Scholar] [CrossRef]
- Franchini, S. Replica Symmetry Breaking without replicas I. Pure states and ultrametricity ; LoTGlasSy working paper; 2017. [Google Scholar]
- Franchini, S. Simplified Parisi Ansatz III: Constructive Cavity Method and Ultrametricity. arXiv 2026, arXiv:2610.34710. [Google Scholar]
- Franchini, S. Universal scaling limits for spin networks via martingale methods. Proc. R. Soc. A 2025, 481(2311), 20240774. [Google Scholar] [CrossRef]
- Bardella, G.; Franchini, S.; Pan, L.; Balzan, R.; Ramawat, S.; Brunamonti, E.; Pani, P.; Ferraina, S. Neural activity in quarks language: Lattice Field Theory for a network of real neurons. Entropy 2024, 26(6), 495. [Google Scholar] [CrossRef] [PubMed]
- Bardella, G.; Franchini, S.; Pani, P.; Ferraina, S. Lattice physics approaches for neural networks. iScience 2024, 27(12), 111390. [Google Scholar] [CrossRef] [PubMed]
- Varadarajan, V. S. Some remarks on arithmetic physics. J. Stat. Plan. Inference 2002, 103(1–2), 3–13. [Google Scholar] [CrossRef]
- Varadarajan, V. S. Arithmetic Quantum Physics: Why, What, and Whither. Tr. Mat. Instituta Im. V.A. Steklova 2004, 245, 273–280. [Google Scholar]
- Wolf, M. Applications of statistical mechanics in number theory. Physica A Stat. Mech. Its Appl. 1999, 274(1–2), 149–157. [Google Scholar] [CrossRef]
- Derrida, B. A generalization of the random energy model which includes correlations between energies. J. Phys. Lett. 1985, 46, L401–L407. [Google Scholar] [CrossRef]
- Kistler, N. Derrida’s random energy models. From spin glasses to the extremes of correlated random fields. arXiv 2014, arXiv:1412.0958. [Google Scholar]
- Schumayer, D.; Hutchinson, D. A. W. Physics of the Riemann Hypothesis . Rev. Mod. Phys. Erratum: Rev. Mod. Phys. 83, 769 (2011). 2011, 83, 307. [Google Scholar] [CrossRef]
- Berry, M. V.; Keating, J. P. The Riemann zeros and eigenvalue asymptotics. SIAM Rev. 1999, 41, 236. [Google Scholar] [CrossRef]
- Fyodorov, Y. V.; Hiary, G. A.; Keating, J. P. Freezing Transition, Characteristic Polynomials of Random Matrices, and the Riemann Zeta-Function. Phys. Rev. Lett. 2012, 108, 170601. [Google Scholar] [CrossRef] [PubMed]
- Arguin, L. P.; Tai, W.; Sidoravicius, V. (Eds.) Is the Riemann zeta function in a short interval a 1-RSB spin glass? In Sojourns in Probability Theory and Statistical Physics - I. Springer Proceedings in Mathematics & Statistics; Springer: Singapore, 2019; p. 298. [Google Scholar]
- Sierra, G. The Riemann Zeros as Spectrum and the Riemann Hypothesis. Symmetry 2019, 11, 494. [Google Scholar] [CrossRef]
- Bender, C. M.; Brody, D. C.; Müller, M. P. Hamiltonian for the zeros of the Riemann zeta function. Phys. Rev. Lett. 2017, 118, 130201. [Google Scholar] [CrossRef] [PubMed]
- Moxley, F. I. A Schrödinger equation for solving the Bender-Brody-Müller conjecture. AIP Conf. Proc. 2017, 1905, 030024. [Google Scholar] [CrossRef]
- Julia, B. L. Statistical theory of numbers . In Number Theory and Physics; Springer Proceedings in Physics 47; Luck, J. M., Moussa, P., Waldschmidt, M., Eds.; Springer-Verlag: Berlin, 1990; pp. 276–293. [Google Scholar]
- Spector, D. Supersymmetry and the Möbius Inversion Function. Commun. Math. Phys. 1990, 127, 239–252. [Google Scholar] [CrossRef]
- Khrennikov, A. Yu.; Kozyrev, S. V. Replica symmetry breaking related to a general ultrametric space I: Replica matrices and functionals. Physica A Stat. Mech. Its Appl. 2006, 359, 222–240. [Google Scholar] [CrossRef]
- Weiss, C.; Page, S.; Holthaus, M. Factorising numbers with a Bose–Einstein condensate. Physica A Stat. Mech. Its Appl. 2004, 341, 586–606. [Google Scholar] [CrossRef]
- Franchini, S. Replica Symmetry Breaking without Replicas. PTCC Work. Pap. 2016, arXiv:1610.03941v4. [Google Scholar] [CrossRef]
- Franchini, S.; Concetti, F.; Bardella, G.; Pan, L. Constructive Cavity Method for Ising Restricted and Deep Boltzmann Machines with Gaussian Couplings. arXiv 2026, arXiv:2610.36505. [Google Scholar]
- Franchini, S.; Concetti, F.; Bardella, G. The Constructive Cavity Method for the Ising Perceptron. arXiv 2026, arXiv:2610.39141. [Google Scholar]
- Franchini, S.; Bardella, G. Lattice Field Theory for a network of real neurons. Proc. Sci. 2026, 518, 178. [Google Scholar] [CrossRef]
| 1 | We expect that adjusting the functional order parameter in the Parisi theory of the SK model amounts to finding a suitable base for the problem; also, we expect that the branching ratio of the Ruelle Cascade is the continuous analogue to that of a random base; this should be formalized in some way. |
Figure 1.
Binary kernel describing the first natural numbers (zero included). The numbers are organized as columns of the kernel, ordered from the smallest number, 0, on the left to the largest, , on the far right. The index i runs from 1 at the bottom to N at the top (shown on the right). The corresponding base vector to construct the map is shown on the left.
Figure 1.
Binary kernel describing the first natural numbers (zero included). The numbers are organized as columns of the kernel, ordered from the smallest number, 0, on the left to the largest, , on the far right. The index i runs from 1 at the bottom to N at the top (shown on the right). The corresponding base vector to construct the map is shown on the left.

Figure 2.
Rescaled kernel: the weighted sum of each column is exactly the original number rescaled by the factor . The numbers are ordered from 0 on the left to 255 on the right.
Figure 2.
Rescaled kernel: the weighted sum of each column is exactly the original number rescaled by the factor . The numbers are ordered from 0 on the left to 255 on the right.

Figure 3.
Dual kernel obtained by reversing the geometric weights of the rows, providing a schematic illustration inspired by the formal continuation discussed in [1].
Figure 3.
Dual kernel obtained by reversing the geometric weights of the rows, providing a schematic illustration inspired by the formal continuation discussed in [1].

Figure 7.
Mixed-base approximation of the Primon Gibbs kernel for and . The bounds and determine the common base , with digits. From bottom to top, the first two rows contain binary digits and the third contains ternary digits. Labels inside the blocks show the successive prefixes, producing two, four and twelve blocks at the three levels. White, light blue-grey and dark blue-grey encode the last digit values 0, 1 and 2, respectively. The positive integer labels above the columns are obtained by adding one to the mixed-base map of Eq. (31). Column widths follow the Gibbs weights of Eq. (44), renormalized over the twelve displayed integers; the width of each prefix block is the sum of the widths of its descendant columns. The thick vertical line after 4 separates the regular set from the region beginning at the first gap, , highlighted by the translucent red overlay. Below this threshold, the consecutive mixed-base numbering agrees with the integers admitted by the bounded prime spectrum. Beyond it, the mixed-base numbering continues consecutively, whereas the available prime factors and their bounded multiplicities admit only 6 and 12. The red region therefore identifies where the correspondence is no longer guaranteed. Equation (49) controls the Gibbs mass of this region and its decay as the number of retained primes increases at fixed temperature, or as the temperature decreases at fixed truncation.
Figure 7.
Mixed-base approximation of the Primon Gibbs kernel for and . The bounds and determine the common base , with digits. From bottom to top, the first two rows contain binary digits and the third contains ternary digits. Labels inside the blocks show the successive prefixes, producing two, four and twelve blocks at the three levels. White, light blue-grey and dark blue-grey encode the last digit values 0, 1 and 2, respectively. The positive integer labels above the columns are obtained by adding one to the mixed-base map of Eq. (31). Column widths follow the Gibbs weights of Eq. (44), renormalized over the twelve displayed integers; the width of each prefix block is the sum of the widths of its descendant columns. The thick vertical line after 4 separates the regular set from the region beginning at the first gap, , highlighted by the translucent red overlay. Below this threshold, the consecutive mixed-base numbering agrees with the integers admitted by the bounded prime spectrum. Beyond it, the mixed-base numbering continues consecutively, whereas the available prime factors and their bounded multiplicities admit only 6 and 12. The red region therefore identifies where the correspondence is no longer guaranteed. Equation (49) controls the Gibbs mass of this region and its decay as the number of retained primes increases at fixed temperature, or as the temperature decreases at fixed truncation.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.