Maths Olympiad Prep

Track / Stage 4 / 104 of 340 #1004 of 2604

Problem 1004

AMC 12 late, AIME early
Number theory Difficulty 4.6 Prove it Brazilian Mathematical Olympiad · 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.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official 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(2k−1)+f(1)+f(2)+⋯+f(2k−1−1)+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=2Sk−1−f(2k−1)+f(2k) \Leftrightarrow S_k = 2S_{k-1} - f(2^{k-1}) + f(2^k)
⇔Sk=2(Sk−1+k) \Leftrightarrow S_k = 2(S_{k-1} + k)
If n=(atat−1…a0)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)=∑ai⋅Sif(1) + \dots + f(n) = \sum a_i \cdot S_i. Also, by induction, Sk>Sk−1+⋯+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.

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