Maths Olympiad Prep

Library / /1 of 6

Number theory Difficulty 4.6 AIME Prove it Brazil

Let f:Z+Z+f: \mathbb{Z}_{+}^{*} \rightarrow \mathbb{Z}_{+}^{*} be a function defined as follows: given nn, we write n=2a(2b+1)n = 2^a \cdot (2b+1), with aa and bb non-negative integers, and define f(n)=a2+a+1f(n) = a^2 + a + 1.

Determine the least positive integer nn such that f(1)+f(2)++f(n)123456f(1) + f(2) + \cdots + f(n) \ge 123456.

Solution

Let Sk=f(1)+f(2)+f(3)++f(2k)S_k = f(1) + f(2) + f(3) + \dots + f(2^k). Then
Sk=f(1)+f(2)++f(2k1)+f(1)+f(2)++f(2k11)+f(2k) S_k = f(1) + f(2) + \dots + f(2^{k-1}) + f(1) + f(2) + \dots + f(2^{k-1} - 1) + f(2^k)
Sk=2Sk1f(2k1)+f(2k) \Leftrightarrow S_k = 2S_{k-1} - f(2^{k-1}) + f(2^k)
Sk=2(Sk1+k) \Leftrightarrow S_k = 2(S_{k-1} + k)
If n=(atat1a0)2n = (a_t a_{t-1} \dots a_0)_2 is the binary expansion of nn, it is easy to see that f(1)++f(n)=aiSif(1) + \dots + f(n) = \sum a_i \cdot S_i. Also, by induction, Sk>Sk1++S0S_k > S_{k-1} + \dots + S_0, so that in order to obtain the least nn satisfying f(1)++f(n)123456f(1) + \dots + f(n) \ge 123456, we have to choose
S14+S13+S7+S2+S1=123456, S_{14} + S_{13} + S_7 + S_2 + S_1 = 123456,
that is, n=214+213+27+22+21=24710n = 2^{14} + 2^{13} + 2^7 + 2^2 + 2^1 = 24710.

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

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.