Maths Olympiad Prep

Library / /10 of 15

Algebra Difficulty 6.4 National Olympiad Prove it Philippines

Problem:

Consider the function f:NZf: \mathbb{N} \rightarrow \mathbb{Z} satisfying, for all nNn \in \mathbb{N},

a. f(n)=n|f(n)|=n

b. 0k=1nf(k)<2n0 \leq \sum_{k=1}^{n} f(k)<2 n.

Evaluate n=12018f(n)\sum_{n=1}^{2018} f(n).

Solution

Solution:

Let Sn=k=1nf(k)S_{n}=\sum_{k=1}^{n} f(k). We want the value of S2018S_{2018}.

Claim: f(n)={n if Sn1<nn if Sn1nf(n)= \begin{cases}n & \text{ if } S_{n-1}<n \\ -n & \text{ if } S_{n-1} \geq n\end{cases}

Proof: The inequality condition is 0Sn1+f(n)<2n0 \leq S_{n-1}+f(n)<2 n.

- If n>Sn1n>S_{n-1}, then 0Sn1+f(n)<n+f(n)0 \leq S_{n-1}+f(n)<n+f(n) so f(n)>nf(n)>-n. Therefore, f(n)=nf(n)=n.
- If nSn1n \leq S_{n-1}, then n+f(n)Sn1+f(n)<2nn+f(n) \leq S_{n-1}+f(n)<2 n so f(n)<nf(n)<n. Therefore, f(n)=nf(n)=-n.

Claim: If Sn=0S_{n}=0, then

Sn+1S_{n+1}Sn+2S_{n+2}Sn+3S_{n+3}Sn+4S_{n+4}\cdotsSn+2jS_{n+2j}Sn+2j+1S_{n+2j+1}\cdots
n+1n+12n+32n+3nn2n+42n+4\cdots2n+2+j2n+2+jn+1jn+1-j\cdots

where j=1,2,,n+1j=1,2, \ldots, n+1.

The pattern here: Sn+1,Sn+3,Sn+5,S_{n+1}, S_{n+3}, S_{n+5}, \ldots are numbers decreasing by 1, while Sn+2,Sn+4,Sn+6,S_{n+2}, S_{n+4}, S_{n+6}, \ldots are numbers increasing by 1.

Proof: Sn=0<nS_{n}=0<n so f(n+1)=n+1f(n+1)=n+1. Thus, Sn+1=0+(n+1)=n+1S_{n+1}=0+(n+1)=n+1.

Sn+1=n+1<n+2S_{n+1}=n+1<n+2 so f(n+2)=n+2f(n+2)=n+2. Thus, Sn+2=n+1+(n+2)=2n+3S_{n+2}=n+1+(n+2)=2n+3.

Sn+2=2n+3>n+3S_{n+2}=2n+3>n+3 so f(n+3)=n3f(n+3)=-n-3. Thus, Sn+3=2n+3+(n3)=nS_{n+3}=2n+3+(-n-3)=n.

We prove the claim by strong induction. Suppose the pattern holds for Sn+1,Sn+2,,Sn1+2jS_{n+1}, S_{n+2}, \ldots, S_{n-1+2j}.

Since Sn1+2j=Sn+1+2(j1)=n+1(j1)=n+2j<n+2jS_{n-1+2j}=S_{n+1+2(j-1)}=n+1-(j-1)=n+2-j<n+2j, then f(n+2j)=n+2jf(n+2j)=n+2j so Sn+2j=(n+2j)+(n+2j)=2n+2+jS_{n+2j}=(n+2-j)+(n+2j)=2n+2+j.

On the other hand, since Sn+2j=2n+2+j=(n+2j+1)+(n+1j)n+2j+1S_{n+2j}=2n+2+j=(n+2j+1)+(n+1-j) \geq n+2j+1, then f(n+2j+1)=(n+2j+1)f(n+2j+1)=-(n+2j+1) so Sn+2j+1=(2n+2+j)(n+2j+1)=n+1jS_{n+2j+1}=(2n+2+j)-(n+2j+1)=n+1-j, which proves the claim.

Eventually, Sn+1,Sn+3,,Sn+2j+1,S_{n+1}, S_{n+3}, \ldots, S_{n+2j+1}, \ldots will decrease to 0, when j=n+1j=n+1. Thus, if Sn=0S_{n}=0, it follows that the next 0 value is S3(n+1)S_{3(n+1)}.

Therefore, S3=0S_{3}=0, S34=S12=0S_{3 \cdot 4}=S_{12}=0, S313=S39=0S_{3 \cdot 13}=S_{39}=0, S340=S120=0S_{3 \cdot 40}=S_{120}=0, S3121=S363=0S_{3 \cdot 121}=S_{363}=0, S3364=S1092=0S_{3 \cdot 364}=S_{1092}=0.

Since 2018=1092+24632018=1092+2 \cdot 463, then S2018=21092+2+463=2649S_{2018}=2 \cdot 1092+2+463=2649.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.