Maths Olympiad Prep

Library / /1371 of 1394

, 2016

Algebra Difficulty 6.3 National Olympiad Prove it United States

Problem:

Define the sequence a1,a2a_{1}, a_{2} \ldots as follows: a1=1a_{1}=1 and for every n2n \geq 2,
an={n2 if an1=0an11 if an10 a_{n}= \begin{cases}n-2 & \text{ if } a_{n-1}=0 \\ a_{n-1}-1 & \text{ if } a_{n-1} \neq 0\end{cases}
A non-negative integer dd is said to be jet-lagged if there are non-negative integers r,sr, s and a positive integer nn such that d=r+sd=r+s and that an+r=an+sa_{n+r}=a_{n}+s. How many integers in {1,2,,2016}\{1,2, \ldots, 2016\} are jet-lagged?

Solution

Solution:

Let N=n+rN=n+r, and M=nM=n. Then r=NMr=N-M, and s=aNaMs=a_{N}-a_{M}, and d=r+s=(aN+N)(aM+M)d=r+s=\left(a_{N}+N\right)-\left(a_{M}+M\right). So we are trying to find the number of possible values of (aN+N)(aM+M)\left(a_{N}+N\right)-\left(a_{M}+M\right), subject to NMN \geq M and aNaMa_{N} \geq a_{M}.
Divide the aia_{i} into the following "blocks":
- a1=1,a2=0a_{1}=1, a_{2}=0,
- a3=1,a4=0a_{3}=1, a_{4}=0,
- a5=3,a6=2,a7=1,a8=0a_{5}=3, a_{6}=2, a_{7}=1, a_{8}=0,
- a9=7,a10=6,,a16=0a_{9}=7, a_{10}=6, \ldots, a_{16}=0,
and so on. The kthk^{th} block contains aia_{i} for 2k1<i2k2^{k-1}<i \leq 2^{k}. It's easy to see by induction that a2k=0a_{2^{k}}=0 and thus a2k+1=2k1a_{2^{k}+1}=2^{k}-1 for all k1k \geq 1. Within each block, the value an+na_{n}+n is constant, and for the kk th block (k1)(k \geq 1) it equals 2k2^{k}. Therefore, d=(aN+N)(aM+M)d=\left(a_{N}+N\right)-\left(a_{M}+M\right) is the difference of two powers of 2 , say 2n2m2^{n}-2^{m}. For any n1n \geq 1, it is clear there exists an NN such that aN+N=2na_{N}+N=2^{n} (consider the nthn^{th} block). We can guarantee aNaMa_{N} \geq a_{M} by setting M=2mM=2^{m}. Therefore, we are searching for the number of integers between 1 and 2016 that can be written as 2n2m2^{n}-2^{m} with nm1n \geq m \geq 1. The pairs ( n,mn, m ) with n>m1n>m \geq 1 and n10n \leq 10 all satisfy 12n2m20161 \leq 2^{n}-2^{m} \leq 2016 ( 45 possibilities). In the case that n=11n=11, we have that 2n2m20162^{n}-2^{m} \leq 2016 so 2m322^{m} \geq 32, so m5m \geq 5 ( 6 possibilities). There are therefore 45+6=5145+6=51 jetlagged numbers between 1 and 2016.

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.