maa.org/putnam
PUTNAM
Mathematical Competition
Problems for
Session A
The 81st William Lowell Putnam Mathematical Competition
, William Lowell
maa.org/putnam
PUTNAM
Mathematical Competition
Problems for
Session B
The 81st William Lowell Putnam Mathematical Competition
, A1. How many positive integers N satisfy all of the following three conditions?
(i) N is divisible by 2020.
(ii) N has at most 2020 decimal digits.
(iii) The decimal digits of N are a string of consecutive ones followed by a string of
consecutive zeros.
Answer. 504 · 1009 = 508536.
Solution 1. A positive integer N satisfying (iii), with j ones followed by k zeros, has the
form
10j − 1
N= · 10k
9
where j ≥ 1, k ≥ 0, and j + k ≤ 2020. Note that 2020 = 20 · 101, so to satisfy (i) the integer
N must be divisible by 101 and end in at least two zeros (so k ≥ 2). If 101 divides N then 101
divides M = 10j − 1. A quick check shows that M ≡ 0, 9, 99, 90 mod 101 when j ≡ 0, 1, 2, 3
mod 4. Consequently, 4 must divide j. (One can see directly that the conditions k ≥ 2, 4|j
are necessary and sufficient by noting that 101 divides 1111 but not 1, 11 or 111.)
If j = 4m, then for N to satisfy (ii) also, we need 2 ≤ k ≤ 2020 − 4m, for a total of
2019 − 4m possible values of k. The total number of integers N satisfying all the conditions
is therefore
504
X 504 · 505
(2019 − 4m) = 2019 · 504 − 4 · = 504 · (2019 − 1010) = 504 · 1009 = 508536.
m=1
2
Solution 2. As in the first solution, it is straightforward to show that the acceptable
numbers N are those for which there are at most 2020 decimal digits, consisting of j ones
with 4|j followed by k zeros with k ≥ 2. By introducing additional “phantom” digits z
at the beginning of the number, we can convert it to a string of length exactly 2020 of
the form zzz · · · z111 · · · 1000 · · · 0. We now show that the set of such strings is in bijective
correspondence with a set of size 1009
2
= 508536. To see this, remove the final two zeros
from the string, and group the remaining 2018 positions in the string into consecutive pairs.
Then any choice of 2 of these 1009 pairs corresponds to a unique string of the desired form,
as follows. If the two chosen pairs have an even number of pairs between them, put a z in
each position before the first chosen pair, put 11 for each of the chosen pairs and all pairs in
between, and put a 0 in each position after the second chosen pair, for example:
xx |{z}
|{z} xx |{z}
xx |{z}
xx |{z} xx · · · 7→ zz | 11 | 11 | 11 | 11 | 00 · · · .
xx |{z}
Choose Choose
If the two chosen pairs are separated by an odd number of pairs, do the same except for
replacing the chosen pairs by z1 and 10, respectively, for example:
xx |{z}
|{z} xx |{z}
xx |{z} xx · · · 7→ zz | z1 | 11 | 10 | 00 · · · .
xx |{z}
Choose Choose
Note that in either case, the resulting number of ones is divisible by 4. Erasing the digits
z and restoring the two zeros that were removed at the end of the string, we get every
acceptable number N exactly once from some choice of 2 of the 1009 consecutive pairs.