Maths Olympiad Prep

Library / Harvard-MIT Mathematics Tournament /298 of 352

Harvard-MIT Mathematics Tournament

Number theory Difficulty 5.6 AIME, harder Prove it United States

Problem:

Given a positive integer nn, a sequence of integers a1,a2,…,ara_{1}, a_{2}, \ldots, a_{r}, where 0≤ai≤k0 \leq a_{i} \leq k for all 1≤i≤r1 \leq i \leq r, is said to be a "kk-representation" of nn if there exists an integer cc such that
∑i=1rai=∑i=1raikc−i=n. \sum_{i=1}^{r} a_{i} = \sum_{i=1}^{r} a_{i} k^{c-i} = n.
Prove that every positive integer nn has a kk-representation, and that the kk-representation is unique if and only if 0 does not appear in the base-kk representation of n−1n-1.

Solution

Solution:

Equivalently, a kk-representation is given by a sequence ap,…,aqa_{p}, \ldots, a_{q}, for some p<qp < q, such that
∑i=pqai=∑i=pqaiki. \sum_{i=p}^{q} a_{i} = \sum_{i=p}^{q} a_{i} k^{i}.
We first show existence. Let the representation of n−1n-1 in base kk be given by ∑i=0raiki=n−1\sum_{i=0}^{r} a_{i} k^{i} = n-1. Let l=∑i=1rai(ki−1+ki−2+⋯+1)l = \sum_{i=1}^{r} a_{i} (k^{i-1} + k^{i-2} + \cdots + 1). Now we extend the sequence {ai}\{a_{i}\} by letting ai=k−1a_{i} = k-1 if −l+1≤i≤−1-l+1 \leq i \leq -1 and a−l=ka_{-l} = k. We claim that a−l,…,ar−1,ara_{-l}, \ldots, a_{r-1}, a_{r} is a kk-representation of nn. Indeed,
∑i=−lraiki=(n−1)+(∑i=−l−1(k−1)ni)+k−l=(n−1)+(k−1)k−11−k−l1−k−1+k−l=n∑i=−lrai=(∑i=0rai)+l(k−1)+1=(∑i=0rai)+(∑i=1rai(ki−1))+1=(∑i=0raiki)+1=n \begin{aligned} \sum_{i=-l}^{r} a_{i} k^{i} & = (n-1) + \left( \sum_{i=-l}^{-1} (k-1) n^{i} \right) + k^{-l} \\ & = (n-1) + (k-1) k^{-1} \frac{1 - k^{-l}}{1 - k^{-1}} + k^{-l} = n \\ \sum_{i=-l}^{r} a_{i} & = \left( \sum_{i=0}^{r} a_{i} \right) + l(k-1) + 1 \\ & = \left( \sum_{i=0}^{r} a_{i} \right) + \left( \sum_{i=1}^{r} a_{i} (k^{i} - 1) \right) + 1 \\ & = \left( \sum_{i=0}^{r} a_{i} k^{i} \right) + 1 = n \end{aligned}
Now suppose there is another kk-representation {bi}\{b_{i}\} of nn; then ∑bi=∑biki=n\sum b_{i} = \sum b_{i} k^{i} = n. This implies that ∑ci=∑ciki=0\sum c_{i} = \sum c_{i} k^{i} = 0 where ci=ai−bic_{i} = a_{i} - b_{i}. The following claim specifies all possibilities of {ci}\{c_{i}\}.

Claim: Suppose that ∑i=pqciki=0\sum_{i=p}^{q} c_{i} k^{i} = 0, where ci,p,q∈Z,p<qc_{i}, p, q \in \mathbb{Z}, p < q, and ci∈[−k,k]c_{i} \in [-k, k]. Then the sequence {ci}\{c_{i}\} must be the concatenation of subsequences of the form
±(1,1−k,1−k,…,1−k,−k) \pm(1, 1-k, 1-k, \ldots, 1-k, -k)
possibly with 0's in between.

Proof. If cic_{i} is not the zero sequence, then without loss of generality, we may assume cq>0c_{q} > 0.
Since ∑i=pqciki=0\sum_{i=p}^{q} c_{i} k^{i} = 0, we have
∣cqkq∣=∣cq−1kq−1+…+cpkp∣≤kq+kq−1+…+kp+1<kk−1kq≤2kq |c_{q} k^{q}| = |c_{q-1} k^{q-1} + \ldots + c_{p} k^{p}| \leq k^{q} + k^{q-1} + \ldots + k^{p+1} < \frac{k}{k-1} k^{q} \leq 2 k^{q}
so cq=1c_{q} = 1. Now we have
kq+cq−1kq−1+…+cpkp=0 k^{q} + c_{q-1} k^{q-1} + \ldots + c_{p} k^{p} = 0
This means (k+cq−1)kq−1+…+cpkp=0(k + c_{q-1}) k^{q-1} + \ldots + c_{p} k^{p} = 0. Hence, as above,
∣(k+cq−1)kq−1∣=∣cq−2kq−2+…+cpkp∣<2kq−1 | (k + c_{q-1}) k^{q-1} | = | c_{q-2} k^{q-2} + \ldots + c_{p} k^{p} | < 2 k^{q-1}
Therefore, ∣k+cq−1∣<2|k + c_{q-1}| < 2, which means cq−1=−kc_{q-1} = -k or −k+1-k+1.
If cq−1=−kc_{q-1} = -k, then cqkq+cq−1kq−1=0c_{q} k^{q} + c_{q-1} k^{q-1} = 0, and we get a subsequence (1,−k)(1, -k).
If cq−1=−k+1c_{q-1} = -k+1, then cqkq+cq−1kq−1=kq−1c_{q} k^{q} + c_{q-1} k^{q-1} = k^{q-1}. Thus
kq−1+cq−2kq−2+…+cpkp=0 k^{q-1} + c_{q-2} k^{q-2} + \ldots + c_{p} k^{p} = 0
which has the exact same form as (1). We can then repeat this procedure to obtain a subsequence (1,1−k,1−k,…,1−k,−k)(1, 1-k, 1-k, \ldots, 1-k, -k).
Once we have such a subsequence, the terms in the sum ∑i=pqciki=0\sum_{i=p}^{q} c_{i} k^{i} = 0 corresponding to that subsequence sum to 0, so we may remove them and apply the same argument.

We now consider the cases.
If the base kk representation of n−1n-1 contains no 0's, then ai≠0a_{i} \neq 0 so it is impossible to have ci=ai−bi=−kc_{i} = a_{i} - b_{i} = -k. On the other hand, we know that cic_{i} is composed of subsequences of the form ±(1,1−k,1−k,…,1−k,−k)\pm(1, 1-k, 1-k, \ldots, 1-k, -k). Therefore, if {ci}\{c_{i}\} is not the zero sequence, then the fact that ∑ci=0\sum c_{i} = 0 implies that we must have both a subsequence (1,1−k,1−k,…,1−k,−k)(1, 1-k, 1-k, \ldots, 1-k, -k) and a subsequence −(1,1−k,1−k,…,1−k,−k)-(1, 1-k, 1-k, \ldots, 1-k, -k), meaning that there exists ii for which ci=−kc_{i} = -k, contradiction.
If the base kk representation of n−1n-1 contains a 0, then picking the largest ii such that ai=0a_{i} = 0, we can change aia_{i} to kk and ai+1a_{i+1} to ai+1−1a_{i+1} - 1, and append a (1,−k)(1, -k) to the end of the sequence. This yields another kk-representation of nn, so a kk-representation of nn is unique if and only if the base kk representation of n−1n-1 contains no 0's, as desired.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.