Skip to content
Vamshi Jandhyala

Books · Monthly Mindbenders: Solutions

Chapter 9

A Multiple Made of Ones

↓ Download PDF handout

A pigeonhole puzzle from the Monthly Mindbenders.1

Problem

Prove that your ten-digit telephone number, if it ends in 11, 33, 77 or 99, has a multiple that, written out in base ten, is nothing but a string of 11s.

Solution

Call the number NN, and write RkR_k for the number made of kk ones, so R1=1R_1 = 1, R2=11R_2 = 11, R3=111R_3 = 111 and so on. These are the repunits. The claim is that NN divides one of them.

The only thing the last digit tells us is that NN is odd and not a multiple of 55, so it shares no factor with 1010. That, it turns out, is all the proof needs. The ten digits are decoration: the argument works for every whole number that shares no factor with 1010.

Consider the first N+1N + 1 repunits, R1,R2,,RN+1R_1, R_2, \dots, R_{N+1}, and their remainders on division by NN. There are only NN possible remainders, from 00 to N1N-1, and there are N+1N+1 repunits, so two of them leave the same remainder. Say RiR_i and RjR_j, with i<ji < j. Their difference is then a multiple of NN, and it has a very particular shape. Subtracting ii ones from jj ones leaves jij - i ones followed by ii zeros, so RjRi  =  Rji×10i.R_j - R_i \;=\; R_{j-i} \times 10^{i} . For instance R5R2=1111111=11100=R3×102R_5 - R_2 = 11111 - 11 = 11100 = R_3 \times 10^2. So NN divides Rji×10iR_{j-i} \times 10^{i}. But NN shares no factor with 1010, and so none with 10i10^{i}, which means every factor of NN must be found in RjiR_{j-i}. Hence NN divides RjiR_{j-i}.  N divides the repunit Rji, a string of ji ones. \boxed{\ N \text{ divides the repunit } R_{j-i}, \text{ a string of } j-i \text{ ones.} \ }

Why the last digit is exactly the right condition

Every repunit ends in 11, so every repunit is odd and none is a multiple of 55. A number ending in 00, 22, 44, 55, 66 or 88 has a factor of 22 or 55 and can therefore divide no repunit at all. So the puzzle’s condition marks exactly the dividing line, both sufficient and necessary.

A tempting shortcut, and where it breaks

There is a quicker-looking route. Since NN shares no factor with 1010, some power of ten leaves remainder 11 on division by NN, say 10k10^k. Then NN divides 10k1=999=9Rk10^k - 1 = 99\ldots9 = 9 R_k, and it is natural to conclude that NN divides RkR_k.

That last step fails whenever NN is a multiple of 33. Take N=3N = 3: already 10110^1 leaves remainder 11, so 33 divides 9R1=99 R_1 = 9, but 33 does not divide R1=1R_1 = 1. The true answer for 33 is R3=111=3×37R_3 = 111 = 3 \times 37. The factor 99 can soak up some or all of the threes in NN, and dividing it away loses them.

The shortcut can be repaired by asking instead for a power of ten that leaves remainder 11 on division by 9N9N, which also exists. The pigeonhole argument above never needs repairing, because it never divides by anything: it works with the repunits directly.

How long the string is

The same reasoning pins down the shortest string exactly. The repunit RkR_k equals (10k1)/9(10^k - 1)/9, so NN divides RkR_k precisely when 9N9N divides 10k110^k - 1. The shortest such kk is the smallest power for which 10k10^k leaves remainder 11 on division by 9N9N, the multiplicative order of 1010 modulo 9N9N.

For a ten-digit number this is enormous. Taking (212)555-0171(212)\,555\text{-}0171 as an example, the shortest string of ones that it divides has 8,334,0008{,}334{,}000 digits, and that is on the short side: across 395395 random ten-digit numbers ending in 11, 33, 77 or 99 the median length is about 217217 million, and only one in seventeen needs fewer than a million ones. The pigeonhole argument promises at most NN ones, a few billion, and the true figure is usually well inside that bound while still far too long to write out.

The computation

The check takes 400400 numbers ending in 11, 33, 77 or 99. They are the small awkward cases 33, 99, 2727, 8181 and 3737, the example above, and random ten-digit numbers, 143143 of them multiples of 33. For each, it finds the multiplicative order kk of 1010 modulo 9N9N and confirms that 10k10^k leaves remainder 11 on division by 9N9N. That is the same as NN dividing RkR_k. The small cases get a second, slower check that walks the repunits one at a time, updating the remainder as r10r+1r \mapsto 10r + 1, and finds the first repunit divisible by NN at exactly the kkth.

import sympy as sp

def first_repunit(N):
    """walk R_1, R_2, ... modulo N; return the first k with N | R_k"""
    if N % 2 == 0 or N % 5 == 0:
        return None
    r = 0
    for k in range(1, N + 2):
        r = (10 * r + 1) % N
        if r == 0:
            return k

for N in (3, 9, 27, 81, 37):
    assert first_repunit(N) == sp.n_order(10, 9 * N)

N = 2125550171
k = sp.n_order(10, 9 * N)
print(k, pow(10, k, 9 * N) == 1)        # 8334000 True
print(first_repunit(15), first_repunit(22))   # None None

Every one of the 400400 numbers has a repunit multiple, including all 143143 multiples of 33, and the numbers ending in 55 or an even digit correctly have none. The one pitfall in writing the check is instructive: building RkR_k itself as a number, with kk in the millions, takes far longer than it should, and the powers must be taken modulo 9N9N instead.


  1. Peter Winkler, Monthly Mindbenders, National Museum of Mathematics, September 2026, momath.org/mindbenders.↩︎