Maths Olympiad Prep

Library / HMMT November /508 of 672

HMMT November

Number theory Difficulty 5.2 AIME, harder Find the answer

Find the sum of all positive integers nn such that there exists an integer bb with ∣b∣≠4|b| \neq 4 such that the base -4 representation of nn is the same as the base bb representation of nn.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

All 1 digit numbers, 0,1,2,30,1,2,3, are solutions when, say, b=5b=5. (Of course, d∈{0,1,2,3}d \in \{0,1,2,3\} works for any base bb of absolute value greater than dd but not equal to 4 .) Consider now positive integers n=(ad…a1a0)4n=\left(a_{d} \ldots a_{1} a_{0}\right)_{4} with more than one digit, so d≥1,ad≠0d \geq 1, a_{d} \neq 0, and 0≤ak≤30 \leq a_{k} \leq 3 for k=0,1,…,dk=0,1, \ldots, d. Then nn has the same representation in base bb if and only if ∣b∣>max⁡ak|b|>\max a_{k} and ∑k=0dak(−4)k=∑k=0dakbk\sum_{k=0}^{d} a_{k}(-4)^{k}=\sum_{k=0}^{d} a_{k} b^{k}, or equivalently, ∑k=0dak(bk−(−4)k)=0\sum_{k=0}^{d} a_{k}\left(b^{k}-(-4)^{k}\right)=0. First we prove that b≤3b \leq 3. Indeed, if b≥4b \geq 4, then b≠4⟹b≥5b \neq 4 \Longrightarrow b \geq 5, so bk−(−4)kb^{k}-(-4)^{k} is positive for all k≥1k \geq 1 (and zero for k=0k=0 ). But then ∑k=0dak(bk−(−4)k)≥ad(bd−(−4)d)\sum_{k=0}^{d} a_{k}\left(b^{k}-(-4)^{k}\right) \geq a_{d}\left(b^{d}-(-4)^{d}\right) must be positive, and cannot vanish. Next, we show b≥2b \geq 2. Assume otherwise for the sake of contradiction; bb cannot be 0,±10, \pm 1 (these bases don't make sense in general) or -4 , so we may label two distinct negative integers −r,−s-r,-s with r−1≥s≥2r-1 \geq s \geq 2 such that {r,s}={4,−b},s>max⁡ak\{r, s\}=\{4,-b\}, s>\max a_{k}, and ∑k=0dak((−r)k−(−s)k)=0\sum_{k=0}^{d} a_{k}\left((-r)^{k}-(-s)^{k}\right)=0, which, combined with the fact that rk−sk≥0r^{k}-s^{k} \geq 0 (equality only at k=0k=0 ), yields rd−sd≤ad(rd−sd)=∑k=0d−1(−1)d−1−kak(rk−sk)≤∑k=0d−1(s−1)(rk−sk)=(s−1)rd−1r−1−(sd−1)\begin{aligned} r^{d}-s^{d} \leq a_{d}\left(r^{d}-s^{d}\right) & =\sum_{k=0}^{d-1}(-1)^{d-1-k} a_{k}\left(r^{k}-s^{k}\right) \\ & \leq \sum_{k=0}^{d-1}(s-1)\left(r^{k}-s^{k}\right)=(s-1) \frac{r^{d}-1}{r-1}-\left(s^{d}-1\right) \end{aligned} Hence rd−1≤(s−1)rd−1r−1<(r−1)rd−1r−1=rd−1r^{d}-1 \leq(s-1) \frac{r^{d}-1}{r-1}<(r-1) \frac{r^{d}-1}{r-1}=r^{d}-1, which is absurd. Thus b≥2b \geq 2, and since b≤3b \leq 3 we must either have b=2b=2 or b=3b=3. In particular, all aka_{k} must be at most b−1b-1. We now rewrite our condition as ad(4d−(−b)d)=∑k=0d−1(−1)d−1−kak(4k−(−b)k) a_{d}\left(4^{d}-(-b)^{d}\right)=\sum_{k=0}^{d-1}(-1)^{d-1-k} a_{k}\left(4^{k}-(-b)^{k}\right) Since 4k−(−b)k≥04^{k}-(-b)^{k} \geq 0 for k≥0k \geq 0, with equality only at k=0k=0, we deduce ad(4d−(−b)d)≤∑k≡d−1(b−1)(4k−(−b)k) a_{d}\left(4^{d}-(-b)^{d}\right) \leq \sum_{k \equiv d-1}(b-1)\left(4^{k}-(-b)^{k}\right) If d−1d-1 is even (d(d is odd )), this gives ad(4d+bd)≤(b−1)4d+1−4042−1−(b−1)bd+1−b0b2−1 a_{d}\left(4^{d}+b^{d}\right) \leq(b-1) \frac{4^{d+1}-4^{0}}{4^{2}-1}-(b-1) \frac{b^{d+1}-b^{0}}{b^{2}-1} so 4d<(b−1)4d+115⟹b>1+1544^{d}<(b-1) \frac{4^{d+1}}{15} \Longrightarrow b>1+\frac{15}{4}, which is impossible. Thus d−1d-1 is odd ( dd is even), and we get ad(4d−bd)≤(b−1)4d+1−4142−1+(b−1)bd+1−b1b2−1⟺bd−14d−1≥ad−415(b−1)ad+bb+1 a_{d}\left(4^{d}-b^{d}\right) \leq(b-1) \frac{4^{d+1}-4^{1}}{4^{2}-1}+(b-1) \frac{b^{d+1}-b^{1}}{b^{2}-1} \Longleftrightarrow \frac{b^{d}-1}{4^{d}-1} \geq \frac{a_{d}-\frac{4}{15}(b-1)}{a_{d}+\frac{b}{b+1}} If b=2b=2, then ad=1a_{d}=1, so 12d+1=2d−14d−1≥1125\frac{1}{2^{d}+1}=\frac{2^{d}-1}{4^{d}-1} \geq \frac{11}{25}, which is clearly impossible (d≥2)(d \geq 2). If b=3b=3 and ad=2a_{d}=2, then 9d/2−116d/2−1≤815\frac{9^{d / 2}-1}{16^{d / 2}-1} \leq \frac{8}{15}. Since dd is even, it's easy to check this holds only for d/2=1d / 2=1, with equality, so ak=b−1a_{k}=b-1 if k≡d−1( mod 2)k \equiv d-1(\bmod 2). Thus (ad,…,a0)=(2,2,a0)\left(a_{d}, \ldots, a_{0}\right)=\left(2,2, a_{0}\right), yielding solutions (22x)3(22 x)_{3} (which do work; note that the last digit doesn't matter). Otherwise, if b=3b=3 and ad=14a_{d}=14, then 9d/2−116d/2−1≤415\frac{9^{d / 2}-1}{16^{d / 2}-1} \leq \frac{4}{15}. It's easy to check d/2∈{1,2}d / 2 \in\{1,2\}. If d/2=1d / 2=1, we're solving 16a2−4a1+a0=9a2+3a1+a0⟺a2=a116 a_{2}-4 a_{1}+a_{0}=9 a_{2}+3 a_{1}+a_{0} \Longleftrightarrow a_{2}=a_{1}. We thus obtain the working solution (11x)3(11 x)_{3}. (Note that 110=12220110=\frac{1}{2} 220 in bases −4,3-4,3.) If d/2=2d / 2=2, we want 256a4−64a3+16a2−4a1+a0=81a4+27a3+9a2+3a1+a0256 a_{4}-64 a_{3}+16 a_{2}-4 a_{1}+a_{0}=81 a_{4}+27 a_{3}+9 a_{2}+3 a_{1}+a_{0}, or 175=91a3−7a2+7a1175=91 a_{3}-7 a_{2}+7 a_{1}, which simplifies to 25=13a3−a2+a125=13 a_{3}-a_{2}+a_{1}. This gives the working solutions (1210x)3,(1221x)3(1210 x)_{3},(1221 x)_{3}. (Note that 12100=110212100=110^{2} and 12210=1102+11012210=110^{2}+110 in bases −4,3-4,3.) The list of all nontrivial ( ≥2\geq 2-digit) solutions (in base -4 and bb ) is then 11x,22x,1210x,1221x11 x, 22 x, 1210 x, 1221 x, where b=3b=3 and x∈{0,1,2}x \in\{0,1,2\}. In base 10 , they are 12+x,2⋅12+x,122+x,122+12+x12+x, 2 \cdot 12+x, 12^{2}+x, 12^{2}+12+x, with sum 3(2⋅122+4⋅12)+4(0+1+2)=10203\left(2 \cdot 12^{2}+4 \cdot 12\right)+4(0+1+2)=1020 Finally, we need to include the trivial solutions n=1,2,3n=1,2,3, for a total sum of 1026.

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: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.