Maths Olympiad Prep

Library / /242 of 520

Number theory Difficulty 6.4 National olympiad Find the answer

26. (GBR 2) IMO3 A{ }^{\mathrm{IMO} 3} \mathrm{~A} function ff defined on the positive integers (and taking positive integer values) is given by f(1)=1,f(3)=3f(2n)=f(n)f(4n+1)=2f(2n+1)f(n)f(4n+3)=3f(2n+1)2f(n) \begin{aligned} f(1) & =1, \quad f(3)=3 \\ f(2 n) & =f(n) \\ f(4 n+1) & =2 f(2 n+1)-f(n) \\ f(4 n+3) & =3 f(2 n+1)-2 f(n) \end{aligned} for all positive integers nn. Determine with proof the number of positive integers less than or equal to 1988 for which f(n)=nf(n)=n.

A number or a short expression. Spacing and $ signs are ignored.

Solution

26. The overline in this problem will exclusively denote binary representation. We will show by induction that if n=ckck1c0=i=0kci2i n = \overline{c_k c_{k-1} \ldots c_0} = \sum_{i=0}^{k} c_i 2^i is the binary representation of n(ci{0,1}) n \left( c_i \in \{0,1\} \right) , then f(n)=c0c1ck=i=0kci2ki f(n) = \overline{c_0 c_1 \ldots c_k} = \sum_{i=0}^{k} c_i 2^{k-i} is the number whose binary representation is the palindrome of the binary representation of n n . This evidently holds for n{1,2,3} n \in \{1,2,3\} . Let us assume that the claim holds for all numbers up to n1 n-1 and show it holds for n=ckck1c0 n = \overline{c_k c_{k-1} \ldots c_0} . We observe three cases: (i) c0=0n=2mf(n)=f(m)=0c1ck=c0c1ck c_0 = 0 \Rightarrow n = 2m \Rightarrow f(n) = f(m) = \overline{0 c_1 \ldots c_k} = \overline{c_0 c_1 \ldots c_k} . (ii) c0=1,c1=0n=4m+1f(n)=2f(2m+1)f(m)=21c2ckc2ck=2k+2c2ckc2ck=10c2ck=c0c1ck c_0 = 1, c_1 = 0 \Rightarrow n = 4m + 1 \Rightarrow f(n) = 2f(2m + 1) - f(m) = 2 \cdot \overline{1 c_2 \ldots c_k} - \overline{c_2 \ldots c_k} = 2^k + 2 \cdot \overline{c_2 \ldots c_k} - \overline{c_2 \ldots c_k} = \overline{10 c_2 \ldots c_k} = \overline{c_0 c_1 \ldots c_k} . (iii) c0=1,c1=1n=4m+3f(n)=3f(2m+1)2f(m)=31c2ck2c2ck=2k+2k1+3c2ck2c2ck=11c2ck=c0c1ck c_0 = 1, c_1 = 1 \Rightarrow n = 4m + 3 \Rightarrow f(n) = 3f(2m + 1) - 2f(m) = 3 \cdot \overline{1 c_2 \ldots c_k} - 2 \cdot \overline{c_2 \ldots c_k} = 2^k + 2^{k-1} + 3 \cdot \overline{c_2 \ldots c_k} - 2 \cdot \overline{c_2 \ldots c_k} = \overline{11 c_2 \ldots c_k} = \overline{c_0 c_1 \ldots c_k} . We thus have to find the number of palindromes in binary representation smaller than 1998=11111000100 1998 = \overline{11111000100} . We note that for all mN m \in \mathbb{N} the numbers of 2m 2m - and (2m1) (2m-1) -digit binary palindromes are both equal to 2m1 2^{m-1} . We also note that 11111011111 \overline{11111011111} and 11111111111 \overline{11111111111} are the only 11-digit palindromes larger than 1998. Hence we count all palindromes of up to 11 digits and exclude the largest two. The number of n1998 n \leq 1998 such that f(n)=n f(n) = n is thus equal to 1+1+2+2+4+4+8+8+16+16+322=92 1 + 1 + 2 + 2 + 4 + 4 + 8 + 8 + 16 + 16 + 32 - 2 = 92 .

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: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.