Maths Olympiad Prep

Library / USA Team Selection Test /2 of 33

USA Team Selection Test

Algebra Difficulty 7.3 National Olympiad, round 2 Find the answer

Let ⌊∙⌋\lfloor \bullet \rfloor denote the floor function. For nonnegative integers aa and bb, their bitwise xor, denoted a⊕ba \oplus b, is the unique nonnegative integer such that ⌊a2k⌋+⌊b2k⌋−⌊a⊕b2k⌋ \left \lfloor \frac{a}{2^k} \right \rfloor+ \left\lfloor\frac{b}{2^k} \right\rfloor - \left\lfloor \frac{a\oplus b}{2^k}\right\rfloor is even for every k≥0k \ge 0. Find all positive integers aa such that for any integers x>y≥0x>y\ge 0, we have x⊕ax≠y⊕ay. x\oplus ax \neq y \oplus ay.

Carl Schildkraut

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

Let ⌊∙⌋\lfloor \bullet \rfloor denote the floor function. For nonnegative integers aa and bb, their bitwise xor, denoted a⊕ba \oplus b, is the unique nonnegative integer such that
⌊a2k⌋+⌊b2k⌋−⌊a⊕b2k⌋ \left \lfloor \frac{a}{2^k} \right \rfloor + \left \lfloor \frac{b}{2^k} \right \rfloor - \left \lfloor \frac{a \oplus b}{2^k} \right \rfloor
is even for every k≥0k \ge 0. We aim to find all positive integers aa such that for any integers x>y≥0x > y \ge 0, we have
x⊕ax≠y⊕ay. x \oplus ax \neq y \oplus ay.

To solve this, we consider two cases based on the parity of aa:

1. **Case 1: aa is even**

Suppose aa is even. Then a=2ma = 2m for some integer mm. Consider xx and yy such that x>y≥0x > y \ge 0. We have:
x⊕ax=x⊕2mx x \oplus ax = x \oplus 2mx
y⊕ay=y⊕2my y \oplus ay = y \oplus 2my

Since aa is even, 2m2m is also even. The bitwise xor operation with an even number does not change the parity of the number of 1's in the binary representation. Therefore, x⊕2mxx \oplus 2mx and y⊕2myy \oplus 2my will have the same parity, leading to a contradiction. Hence, for aa even, it is not possible to satisfy the given condition.

2. **Case 2: aa is odd**

Suppose aa is odd. Then a=2m+1a = 2m + 1 for some integer mm. Consider x=2k−1x = 2^k - 1 and y=2k+1y = 2^k + 1 for sufficiently large kk. We have:
x⊕ax=(2k−1)⊕(2m+1)(2k−1) x \oplus ax = (2^k - 1) \oplus (2m + 1)(2^k - 1)
y⊕ay=(2k+1)⊕(2m+1)(2k+1) y \oplus ay = (2^k + 1) \oplus (2m + 1)(2^k + 1)

Since aa is odd, the bitwise xor operation with an odd number will change the parity of the number of 1's in the binary representation. Therefore, x⊕axx \oplus ax and y⊕ayy \oplus ay will not have the same parity, satisfying the given condition.

Thus, the only positive integers aa that satisfy the given condition are the odd integers.

The answer is: All\boxed{\text{All}} odd positive integers}}.

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

Source: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.