← All projects / Overlap and Subtract

Overlap and subtract

Take the table of where each digit lands in the 97s, lay it over the same table for the 67s, and subtract. Everything the two families share cancels to 0. What's left is one carry.

One table minus the other

Every family here is a power of 2 times something, plus a fixed number. The 97s are 3 × 2k + 1 and the 67s are 2k + 3. Each row is one place counted from the end, and each cell is how often that digit lands there, as a percentage.

A adds B adds
Try

A minus B

A has moreB has more0: they agree exactly

These are exact. The last five digits of each family run in a cycle of 2,500 numbers, and the tables count one whole cycle. The number in front of the power of 2 doesn't change them, as long as it isn't a multiple of 5.

Why the 97s and 67s leave just a carry

  1. A power of 2 ends in 2, 4, 8 or 6, a quarter of the time each.
  2. The 67s add 3. When the power ends in 8, that's 8 + 3 = 11: write 1, carry 1. It's the only way a 67 can end in 1, and it's the 25 in the top row.
  3. A power of 2 that ends in 8 always has an even digit before it (28, 48, 68). The carried 1 turns it odd (31, 51, 71). That's the 5 and 15 in the second row.
  4. The 97s add 1 to a number ending in 2, 4, 6 or 8. That never carries, so their second row stays at 10.
  5. From the third row on, both families are exactly even, so the difference is 0.

So the −25 on digit 1 and the row of 5s under it are the same event, seen in two places.

Where else it shows up

In every family of this kind. Add any odd number to the powers of 2 and tally the places. Each cell is the gap between the most and least common digit at that place, in percentage points. 0 means that place is exactly even.

It goes as deep as the number has bits

1 is 1 in binary: one place. 3 is 11: two places. 7 is 111: three. The lean always stops at the place that matches the added number's top bit. Checked for every odd number from −127 to 127.

Each place is on or off

The sizes never vary: 25, 10, 2, 0.4, 0.08, each a fifth of the one before. A place either has exactly that gap or is exactly even. Carries come in pairs that cancel, one turning an even digit odd and the next an odd digit even. A place is on only when one carry is left without a partner.

Taking away works the same

Subtracting 3 instead of adding it gives the same gaps with the odd and even digits swapped. Try −3 against 3 above.

Other multipliers

The same tally for bare powers, with nothing added. This is what the added number has to work with.

Powers of 2, 4, 8, 12 and 64 are exactly even past the last place, so any lean there has to come from what you add. Powers of 3, 7 and 9 lean on their own: a power of 3 never has an odd digit in its tens place.