MathDB
Operations on the real line

Source: Brazil National Olympiad 2019 #2

November 14, 2019
combinatorics

Problem Statement

Given are the real line and the two unique marked points 00 and 11. We can perform as many times as we want the following operation: we take two already marked points aa and bb and mark the reflection of aa over bb. Let f(n)f(n) be the minimum number of operations needed to mark on the real line the number nn (which is the number at a distance n\left| n\right| from 00 and it is on the right of 00 if n>0n>0 and on the left of 00 if n<0n<0). For example, f(0)=f(1)=0f(0)=f(1)=0 and f(1)=f(2)=1f(-1)=f(2)=1. Find f(n)f(n).