The Autocorrelation Formula
Cite this paper
A. S. Petty, The Autocorrelation Formula, DOI: 10.5281/zenodo.21850316.
Abstract
Cyclic digit autocorrelation counts the positions at which a repetend agrees with a shifted copy. An exact Fourier slice computes this count from the digit partition and separates the contribution of one remainder orbit from the aggregate over all orbits. Let and let be prime. The digit function partitions the nonzero residues modulo into digit bins. Let be the same-bin kernel. Let be its additive Fourier transform in both variables.
For every nonzero multiplier modulo , the multiplicative collision count satisfies the exact slice formula When is a primitive root modulo , the remainder orbit of contains every nonzero residue. Its cyclic digit autocorrelation is therefore In this full-period case, is the cyclic Hamming match count of the reciprocal digit sequence. The formula retains the phase information lost by spectral power alone.
The complement law forces to be real and symmetric. When the base has several multiplicative orbits, the same line sum gives their aggregate autocorrelation. An individual orbit has an exact formula involving the corresponding subgroup exponential sum. Outside the primitive-root case, reduction of an individual orbit to the same one-line slice is no longer automatic.
Where Addition Meets Multiplication
The decimal repetend of agrees with itself in all six positions at lag zero and in none under any nontrivial cyclic shift. What forces this complete vanishing without comparing the shifted words?
The repetend of is generated by one arithmetic motion. A remainder emits the digit and moves to . The emitted digits form consecutive bins in the additive ordering of the residues. The remainders move through the multiplicative group. Autocorrelation lies where these two structures meet.
Coordinatewise equality under a cyclic shift is Hamming correlation. Lempel and Greenberger place that statistic in the general theory of finite sequence families [1]. Kak and Chatterjee study Hamming distance between prime-reciprocal digit sequences and their cyclic shifts, together with numerical digit-product autocorrelation [2]. The statistic used below counts equal digits. It is unchanged by relabeling the digit alphabet, whereas a numerical digit-product correlation need not be. Repetend multiplication and its orbit structure are classical [3]. Those results establish the observable and its reciprocal-sequence setting. The result here is the exact two-dimensional transform of the complete digit-bin equality relation, its multiplier-line slice for every nonzero residue, and the separation between the all-orbit aggregate and an individual coset when the base is not primitive.
The squared magnitude of a bin Fourier coefficient records power at one additive frequency. It does not retain the starting phase of the bin. Autocorrelation needs that phase because multiplication moves one interval of residues against another. The natural object is therefore not a one-variable power function. It is the two-dimensional Fourier transform of the relation “these two residues emit the same digit.”
Denote that transform by . Its antidiagonal is the sum of the squared Fourier magnitudes of the digit bins, the function studied in The Spectral Power of the Digit Function [7]. Its other entries retain the phase data. A multiplier selects the line . The sum of along this line is exactly times the number of same-digit matches under multiplication by . This is a finite Fourier slice identity obtained from character orthogonality [6].
The primitive-root condition has one precise role. It makes the remainder orbit of equal to the full multiplicative group. The slice identity itself needs no primitive-root hypothesis. When there are several orbits, it computes their aggregate, while a subgroup sum isolates any chosen orbit.
The Fourier transform is the standard unnormalized transform on the finite cyclic group [6].
The digit partition
Fix an integer and a prime with . Write Represent the nonzero residues by .
Definition 1. For , define For , the th digit bin is Let on and extend it to by setting .
The floor function is nondecreasing, so the nonempty bins are consecutive intervals and occur in digit order. If and then a nonempty bin has the form The ordered vector therefore determines the bins and their starting positions.
Definition 2. The same-bin kernel is
If and are nonzero, then is one when they emit the same digit and zero otherwise. It is also zero when either argument is zero. Thus records the equality relation of the digit partition without retaining the numerical digit labels.
Lemma 3 (Complement reflection). For every , Consequently,
Proof. The number is not an integer. Hence The bin identity follows immediately. Replacing both arguments of by their negatives only replaces digit by digit , so the equality relation is unchanged. ◻
The cross-spectrum
Put For a function on , use the Fourier conventions
Definition 4. The cross-spectrum of the digit partition is
No conjugate is missing from this definition. Conjugation appears on the antidiagonal because .
Theorem 5 (Two-dimensional transform). The cross-spectrum is the two-dimensional Fourier transform of the same-bin kernel. More precisely, Fourier inversion recovers the kernel through
Proof. Expanding the definition gives The second identity is two-dimensional Fourier inversion. ◻
Thus is the same-bin relation written in frequency coordinates.
Corollary 6 (Spectral power). On the antidiagonal, Thus the one-variable spectral power is the antidiagonal of .
Proposition 7 (Reality and symmetry). For all , In particular, the matrix is real, symmetric, and Hermitian.
Proof. Symmetry in and follows from the definition. Lemma 3 gives and therefore Reindexing the digit sum by yields The identity under simultaneous negation follows in the same way. ◻
Corollary 8 (Vanishing total).
Proof. By Theorem 5, the left side is , which is zero. ◻
The interval structure also gives a direct finite expression for every entry of . Define Then and hence This shows directly why the ordered bin lengths determine . The lengths determine the finite geometric factors, while their cumulative sums determine the phases.
The multiplicative slice
Definition 9. For , define the multiplicative collision count
The term at is zero. Thus counts the nonzero residues whose digit is unchanged by multiplication by .
Theorem 10 (Multiplicative slice formula). For every ,
Proof. Insert the inversion formula from Theorem 5. Then Character orthogonality makes the inner sum equal to when and zero otherwise. The surviving line is , which proves the formula. ◻
The selected frequency line is perpendicular to the graph in residue space.
Corollary 11. For every ,
Proof. The first identity follows from for every nonzero . For the second, change variables and use the symmetry of . Then ◻
Although the right side of the slice formula is written in Fourier coordinates, it is therefore a nonnegative integer and is unchanged when the multiplier is inverted.
Repetend autocorrelation
Let The remainders in the base- expansion of are Write
Definition 12. The cyclic digit autocorrelation at lag is
Theorem 13 (Autocorrelation formula). Suppose that is a primitive root modulo . Then , and for every ,
Proof. When is primitive, the remainders run through exactly once. Multiplication by moves the remainder at position to the remainder at position . Therefore The result follows from Theorem 10 with . ◻
The formula explains why phase is necessary. Spectral power sees only , which corresponds to the identity multiplier. A nonzero lag samples a different line, and that line generally passes through off-antidiagonal values of .
The autocorrelation also has a harmonic readout. Define the normalized circulant matrix
Proposition 14 (Harmonic energies). The Fourier characters of diagonalize . Its eigenvalues are They are real and nonnegative. If is primitive, then
Proof. The eigenvalue formula is the standard diagonalization of a circulant matrix [4]. To see nonnegativity directly, put Then The final formula follows by inserting Theorem 13. ◻
When the base has several orbits
The slice theorem remains valid when , but one repetend no longer visits the full nonzero field. Put For a coset , define This is the autocorrelation of the digit word obtained by following the orbit .
Proposition 15 (Orbit aggregation). For every lag , Thus the single-line slice formula computes the sum of the autocorrelations of all multiplicative orbits.
Proof. The cosets of partition . Splitting the defining sum for over those cosets gives the identity. ◻
There is also an exact formula for one chosen orbit. Define
Theorem 16 (Individual orbit formula). For every coset and every lag ,
Proof. Insert the two-dimensional inversion formula for and sum over . The remaining inner sum is exactly . ◻
When , its exponential sum is The vanishing total in Corollary 8 then reduces the double sum to the one-line formula. For a proper subgroup, the values of are subgroup exponential sums rather than a two-valued delta [5]. The individual-orbit formula is still exact, but the clean collapse to one line is no longer automatic.
A Repetend With No Nontrivial Self-Match
Let and . The base has order six modulo seven, so it is a primitive root. The nonempty bins are Every occupied bin is a singleton. Therefore
At lag zero, the selected line is . All seven terms equal six, so For a nonzero lag, put . Then . Along the selected line , the condition becomes Only satisfies it. The line sum is therefore and The repetend is . Its six cyclic shifts agree with it in all six positions at lag zero and in no position at any nonzero lag. The classical Hamming count sees those six comparisons. The two-dimensional transform sees every multiplier at once. One line recovers each count, all cosets remain present before any primitive-root assumption is made, and a subgroup exponential sum can separate them again. For , every nonidentity line sums to zero.
References
[1]A. Lempel and H. Greenberger, Families of sequences with optimal Hamming-correlation properties, IEEE Trans. Inform. Theory 20 (1974), no. 1, 90–94. https://doi.org/10.1109/TIT.1974.1055169.
[2]S. C. Kak and A. Chatterjee, On decimal sequences, IEEE Trans. Inform. Theory 27 (1981), no. 5, 647–652. https://doi.org/10.1109/TIT.1981.1056394.
[3]N. J. Armstrong and R. J. Armstrong, Some properties of repetends, Math. Gaz. 87 (2003), no. 510, 437–443. https://doi.org/10.1017/S0025557200173619.
[4]P. J. Davis, Circulant Matrices, second edition, Chelsea, 1994.
[5]H. Iwaniec and E. Kowalski, Analytic Number Theory, American Mathematical Society, 2004.
[6]A. Terras, Fourier Analysis on Finite Groups and Applications, Cambridge University Press, 1999.
[7]A. S. Petty, The Spectral Power of the Digit Function, research note, October 2021. https://doi.org/10.5281/zenodo.21845198.