The Spectral Power of the Digit Function

The squared bin sizes of the digit function control the alignment limit, the spectral structure, and the collision count. One object, three roles.

The Spectral Power of the Digit Function
Ten bucket sizes. One function on every frequency. The whole harmonic identity of the prime.

Take a prime $p$ in base 10. The digit function $\delta(r) = \lfloor 10r/p \rfloor$ assigns a leading digit to each residue $r = 1, \ldots, p-1$. Group the residues by that digit. The sizes of those ten groups are the bucket sizes of the prime.

At $p = 7$, the bucket sizes are $(0,1,1,0,1,1,0,1,1,0)$. Six residues, six buckets, four empty.

At $p = 13$, they are $(1,1,1,2,1,1,2,1,1,1)$. Eight singletons and two doubled buckets.

At $p = 29$, a mix of 2s and 3s.

Bucket sizes of the digit function

Ten integers. That is the whole data set for any prime, just ten integers, one per digit. Mathematicians have been computing these since Gauss. They sit at the back of every table of repeating decimals ever printed. Nobody asked what shape they made in frequency space.

From buckets to frequencies

The digit function $\delta(r) = \lfloor 10r/p \rfloor$ is monotone in $r$. This is elementary. As $r$ increases, the floor function can only stay level or rise, stepping up by exactly $1$ each time $r$ crosses a multiple of $p/10$. The residues assigned to digit $0$ form a consecutive block. The residues assigned to digit $1$ form the next. All the way through digit $9$.

Consecutive blocks are the native domain of classical Fourier analysis. The Fourier transform of a block of $n$ consecutive elements is a Dirichlet kernel of length $n$, an object computed and tabulated since the early nineteenth century. Each bucket contributes exactly one Dirichlet kernel. Its shape depends entirely on the bucket's size.

The spectral power $\Phi$ squares the magnitude of each bucket's Fourier coefficient and sums over all ten buckets. A nonnegative function of the frequency, built from nothing but those ten integers.

Monotonicity produces consecutive blocks. Consecutive blocks produce Dirichlet kernels. Squared magnitudes sum to $\Phi$. That is the whole construction.

The zeroth mode

At frequency $0$, the Fourier transform of any set is simply its size. A bucket of size $n_d$ contributes $n_d$, and after squaring and summing:

$$\Phi(0) = n_0^2 + n_1^2 + \cdots + n_9^2.$$

Readers of The Alignment Limit will recognize this. It is the bin-sum that governs the alignment formula. The scalar that started this program as a comparison of decimal digits reappears here as $\Phi(0)$, the zeroth Fourier mode. It would be alarming if it did not.

The spectral power does not replace the alignment limit. It contains it.

The case $p = 13$

The bucket structure at $p = 13$ is

digit 0:  {1}         digit 5:  {7}
digit 1:  {2}         digit 6:  {8,9}
digit 2:  {3}         digit 7:  {10}
digit 3:  {4,5}       digit 8:  {11}
digit 4:  {6}         digit 9:  {12}

Eight singletons. Two doubled buckets, at digits 3 and 6.

At frequency $0$:

$$\Phi(0) = 8 \cdot 1^2 + 2 \cdot 2^2 = 16.$$

Away from frequency $0$, the eight singleton buckets contribute identical flat amounts at every frequency. The two doubled buckets are the only source of variation. Their Dirichlet kernels are wider, concentrating more power at low frequencies and producing a slow envelope that falls from its maximum at the low end toward the middle of the spectrum.

The entire non-constant shape of $\Phi$ at $p = 13$ comes from those two doubled buckets. Two integers out of ten. So it goes with Fourier analysis. The variation is always carried by the outliers.

Spectral power of the digit function

At $p = 11$, all occupied buckets are singletons and $\Phi$ is flat. At $p = 13$, two doubled buckets produce a visible low-frequency envelope. At $p = 29$, more variation produces richer structure across the full range.

Two equivalences

The spectral power places two earlier results in the same frame.

The alignment limit equals $\Phi(0)$. That is the zeroth-mode reading of a result that predates the spectral language by several papers.

The digit-partitioning condition becomes a flatness condition. A prime is digit-partitioning exactly when every occupied bucket contains precisely one residue. In that case all singleton Dirichlet kernels are identical, all squared magnitudes are equal, and $\Phi$ is constant across every frequency. Conversely, if $\Phi$ is constant, no bucket can be larger than a singleton. The equivalence holds in both directions.

Three descriptions, one fact. Digit-partitioning. All occupied buckets of size 1. Spectral power flat. The same primes, named three different ways by three different parts of the program, turning out to be the same primes.

The missing half

The spectral power keeps magnitudes and discards phase.

Knowing $|\hat{f}(\xi)|^2$ at every frequency does not recover the eigenvalue spectrum of the cross-alignment matrix. For that, as The Spectral Structure of Fractional Fields shows, one needs to know how the Fourier modes of different buckets align with one another, not just how large they are.

This is the magnitude portrait of the digit function. The phase portrait is a separate paper.

What this portrait does show is already more than those ten integers seemed to promise. The alignment limit is in there. The digit-partitioning classification is in there. The low-frequency structure of the cross-alignment matrix is in there. The digit function is monotone. That single fact was the key. Everything else followed from it.


A note from 2026

April 2026

This paper gives the first full frequency-space portrait of the digit function. Before it, the bucket data sat compressed into a single scalar. Here the whole partition enters Fourier space at once.

The Autocorrelation Formula needs more than a scalar summary. Phase-Filtered Ramanujan Sums and the Spectral Gate studies what happens when the same harmonic data is filtered by residue-class structure. The Collision Spectrum uses the same interval geometry in a different arithmetic setting. The fact underneath all of them is the same. The digit buckets are consecutive runs of residues. Once that is written down, classical harmonic analysis becomes available.

.:.


Try it yourself

$ ./nfield spectral 11
  bucket sizes: 1,1,1,1,1,1,1,1,1,1
  Phi(0) = 10
  Phi flat at every frequency

$ ./nfield spectral 13
  bucket sizes: 1,1,1,2,1,1,2,1,1,1
  Phi(0) = 16
  two doubled buckets, low-frequency envelope

$ ./nfield spectral 29
  bucket sizes: a mix of 2s and 3s
  Phi(0) = 80
  visible variation across the full frequency range

What changes from one prime to the next is not just the total at frequency $0$. The whole shape changes. Ten integers per prime. The digit function is monotone, and that was enough.

Code: github.com/alexspetty/nfield
Paper: The Spectral Power of the Digit Function


Alexander S. Petty
October 2021 (updated April 2026)
.:.