
In 1918 Ramanujan published a paper on a family of sums that now carry his name. At a prime they are about as simple as a sum can be. Each one adds up arrows of length one, and depending on its argument either the arrows all point the same way and the total is , or they fan out evenly around a circle with one missing and the total is . Ramanujan used them to write familiar arithmetic functions as infinite series, and they have been a working tool of analytic number theory ever since. They also turn up, exactly, in long division. Ask how many remainders keep their first digit when every remainder is multiplied by the same number, and the answer is a sum over the frequency table of The Autocorrelation Formula in which Ramanujan’s two values do the selecting.
The question I brought to it was whether the last digit of a prime decides those counts. Thirteen and fifty-three both end in three, and in decimal that fixes where their larger digit bins sit, at the digits three and six, however big the prime gets. It does not fix which multiplications keep a digit. Doubling moves every remainder of thirteen out of its digit bin, while at fifty-three four remainders keep their digit, and none of the four lives in one of the larger bins.
Here is where the bins come from. Write the twelve fractions from through and look at the first decimal digit of each. There are ten digits for twelve fractions, so most digits appear once, while three appears twice, from and , and six appears twice, from and . Over 53 there are fifty-two fractions, and every digit appears five times except three and six, which appear six times. The extra places stay in the same columns.
Both primes end in three, and that ending is what lands the extra places in the same two columns.
A digit bin collects remainders that emit the same first digit. At thirteen, the digit-three bin is and the digit-six bin is .
For a prime not dividing the base , write
Every bin has or members. Exactly bins get the extra member. We lose one of the extra places because remainder zero is excluded. Digit zero is not excluded. At fifty-three, five fractions begin with it.
The remainder decides which bins are larger, and in decimal, primes other than two and five give four possibilities.
| Last digit of the prime | Larger bins |
|---|---|
| 1 | None |
| 3 | Two |
| 7 | Six |
| 9 | Eight |
The quotient grows with the prime, but the pattern of extra places does not.
Return to thirteen. Double each nonzero remainder, reduce modulo thirteen, and compare its digit before and after the move.
The bin goes to , and neither result stays in the digit-three bin. The bin goes to , and neither stays in the digit-six bin. The other eight bins are singletons, where a remainder could keep its digit only by returning to itself, and doubling fixes no nonzero remainder modulo thirteen. There are no matches anywhere.
Now multiply by six. Five goes to four, since leaves remainder four, and both emit three. Eight goes to nine, and both emit six.
Call the number of matches , where is the multiplier, so we have counted and .
These counts use every nonzero remainder, and a multiplier need not be a power of the base. When it is, the count adds the corresponding shifted matches across all remainder cycles, and only in the full-period case does one repeating block supply the whole count.
The Autocorrelation Formula puts digit equality in a square table , with a one wherever two remainders write the same digit and an empty row and column at zero. Its Fourier transform carries the same information in frequency coordinates, and a line through recovers . Ramanujan’s sum supplies another way to select that line, with two weights and a balance.
For a prime , the sum adds the unit arrows for all nonzero residues. When modulo , all arrows point together. Otherwise they form every th root of unity except the arrow at one, and since the complete set sums to zero, leaving out that arrow gives minus one.
At thirteen,
This is the classical sum from Ramanujan’s 1918 paper, and here its argument is the combined frequency . The collision identity is
Both frequency labels run from zero to . The line receives weight and every other cell receives minus one, so the off-line cells have not been erased.
Let be the bin for digit , and let be its indicator, with . Its Fourier coefficient is the sum of the bin’s rotating arrows,
The equality table and its transform are
There is no conjugate in the second product. Fourier inversion gives
Set and sum over nonzero . Each exponential becomes part of
The left side counts remainders that keep their digit and the right side is the Ramanujan-weighted collision identity, which holds for every nonzero multiplier without a primitive-root assumption.
The full table sums to zero, because Fourier inversion gives . If the selected line sums to , the rest of the table sums to . Apply the two weights,
Divide by and the answer is , so the double sum has become a single line.
At thirteen with multiplier six, the line sums to 26 and the remaining cells sum to . Their weighted total is , and dividing by gives two, with no rounding anywhere. The two are and .
The selected line adds contributions from all the digit bins, each with a magnitude and a phase, and adding them can lose much of the magnitude to cancellation.
To measure that loss, take the magnitude of each bin contribution before adding across bins or frequencies. Call the unsigned total . With along the selected line,
The sum after cancellation is . Define the phase-gate coefficient by
The order of operations matters. Taking after its bins have already been added would miss cancellation between bins and give a different denominator.
At thirteen, multiplier six selects , whose unsigned total is while the signed sum is exactly 26.
Thus , so about eighteen percent of the unsigned mass survives. That is not the fraction of remainders that match, which is .
Each singleton bin supplies a Fourier coefficient of magnitude one at every frequency, so eight such bins and thirteen frequencies contribute to .
Each two-member bin contains neighbors. Their unit arrows differ in angle by , so the sum has magnitude . Along , the product of the two magnitudes is . Both two-member bins contribute the same amount.
Put
The terms satisfy , so these seven values give the entire sum. The displayed decimals are rounded.
| 0 | 1.000000000 |
| 1 | 0.859726283 |
| 2 | 0.502996353 |
| 3 | 0.090223001 |
| 4 | 0.201438535 |
| 5 | 0.265425569 |
| 6 | 0.117034103 |
Count once and each of the other six twice. Their sum is , giving
Only the decimal evaluation is approximate, since the finite cosine sum specifies the denominator exactly.
The gate lies between two bounds,
Its denominator is always positive, because the zero-frequency terms alone contribute the sum of the squared bin sizes, so the gate vanishes exactly when does. At the identity multiplier nothing moves and the gate is one. At thirteen doubling makes it zero, and multiplication by six puts it just above the lower bound .
A zero has a literal meaning in the bins, since it says every bin moves completely away from itself. If even one remainder stays inside its bin, the gate is positive.
The triangle inequality gives , which is the upper bound.
For the lower bound, multiplication by permutes the frequency labels. Cauchy-Schwarz and Parseval give, bin by bin,
Adding over bins yields . Since , division gives .
When , opposite-frequency coefficients are conjugates, every product is a nonnegative squared magnitude, and no cancellation occurs, so .
A positive collision count is an integer at least one, so a positive gate is at least at a fixed prime. That bound shrinks as grows and supplies no uniform positive gap over all primes.
Phase-Filtered Ramanujan Sums and the Spectral Gate gives the complete proofs and the Euclidean bin formula.
Doubling leaves no return at thirteen, so try the same multiplier at fifty-three. The digit-zero bin now contains , and doubling keeps and inside it. The digit-nine bin contains , and doubling modulo fifty-three keeps and inside that bin.
Those are all four matches. The same Ramanujan calculation gives a line sum of and recovers , so the gate is positive.
Every prime below ends in three and has its extra places at digits three and six. The pictures show actual returns, one cell per remainder and multiplier.
Read a row to see which remainders keep their digit under one multiplication. Its number of colored cells is , an empty row means a zero gate, and the bottom row is the identity, so it is completely filled.
These are integer comparisons in the remainder table, not frequency plots, and color names the retained digit with one key shared by all six panels. The largest table has cells, all kept in the full-size plate, and each row count is also checked against its Fourier slice and phase-gate bounds.
These wider plates put the two bin populations alongside their multiplication tests and the Ramanujan weights. The selector’s gold cells carry twelve, not the spectral values being weighted.
The extra places are still at three and six, and none of the four returns uses either of those bins. They happen at zero and nine, where the smaller table had no room for them.
Discussion
Sign in to join the discussion.