Determine all functions $f: \mathbb{Q} \rightarrow \mathbb{Z} $ satisfying \[ f \left( \frac{f(x)+a} {b}\right) = f \left( \frac{x+a}{b} \right) \] for all $x \in \mathbb{Q}$, $a \in \mathbb{Z}$, and $b \in \mathbb{Z}_{>0}$. (Here, $\mathbb{Z}_{>0}$ denotes the set of positive integers.)
Problem
Source: IMO Shortlist 2013, Number Theory #6
Tags: function, number theory, functional equation, IMO Shortlist
11.07.2014 21:30
For convenience, let $P(m, n, p)$ be the statement when $(x, a, b) = (m, n, p)$. If $f(0) \neq 0$:
If $f(0) = 0$:
Therefore, our answers are:
07.08.2014 20:59
lyukhson wrote: Determine all function $f: \mathbb{Q} \rightarrow \mathbb{Z} $ satisfying... By the problem statement, there is $1$ function, and we notice that $f(x)=0$ works. QED
17.08.2014 10:07
The problem was proposed by Konstantin Zabarnyi from Haifa, Israel
04.09.2014 16:56
This one is a great problem, but sadly, leaked before IMO. Anybody interested can see my solution at FE marathon. (Page 65)
09.02.2015 06:37
There are two key plugins: $b=1=a$ and $a,b$ such that $(x+a)/b=x$. Here is my solution using these ideas.
So our 3 solutions are the constant, the floor, and the ceiling, which we can very easily check work.
21.11.2016 02:02
First note that one of the solutions is $f(x)=c$, for $c\in \mathbb{Z}$ and $\forall x\in \mathbb{Q}$. So we'll assume in the following solution that $f$ is non-constant function. Let $A(x \in \mathbb{Q}, a \in \mathbb{Z},b \in \mathbb{Z}_{>0})=f \left( \frac{f(x)+a} {b}\right) = f \left( \frac{x+a}{b} \right)$ be assertion of given FE. $A(x,0,b)\Longrightarrow \underbrace{f \left( \frac{f(x)} {b}\right) = f \left( \frac{x}{b} \right)}_{\bigstar\text{-(big star)}}\stackrel{b=1}{\Longrightarrow} f(f(x))=f(x) \ . \ . \ . \ (\star )$ $A(a\in \mathbb{Z}, -a,b)\Longrightarrow R(a\in \mathbb{Z}, b\in \mathbb{N}):= f\left(\frac{f(a)-a}{b}\right)=f(0)\stackrel{A(a,-f(a),b)}{=}f\left(\frac{a-f(a)}{b}\right) =: R_1(a\in \mathbb{Z}, b\in \mathbb{N})$, $1.)$ $\ \underline{f(a)>a}$ \begin{align*} R(a, f(a)-a)\Longrightarrow f(1)=f(0)\Longrightarrow A(0,a,b)\Longrightarrow f\left( \frac{a}{b}\right)&=f\left( \frac{a+f(0)}{b} \right)=f\left( \frac{a+f(1)}{b} \right)\\ &\stackrel{A(1,a,b)}{=} f\left( \frac{a+1}{b} \right) \\ &= f\left( \frac{a+2}{b} \right) \\ .\\ .\\ . \\ &= f\left( \frac{a+b}{b} \right)= f\left( \frac{a}{b}+1 \right) \\ .\\ .\\ .\\ &\stackrel{n>a}{=} f\left( \frac{a}{b}+\frac{n-a}{b} \right)\\ &= f\left( \frac{n}{b}\right)\\ & \blacksquare \end{align*}___________________________________________________________________________________ $2.)$ $\ \underline{f(a)<a}$ \begin{align*} R_1(a, a-f(a))\Longrightarrow f(-1)=f(0)\Longrightarrow A(0,a,b)\Longrightarrow f\left( \frac{a}{b} \right) &\stackrel{A(-1,a,b)}{=} f\left( \frac{a+f(0)}{b} \right)=f\left(\frac{a+f(-1)}{b}\right) \\ &= f\left( \frac{a-1}{b} \right)\\ &=f\left( \frac{a-2}{b} \right) \\ .\\ .\\ . \\ &= f\left( \frac{a-b}{b} \right)= f\left( \frac{a}{b}-1 \right) \\ .\\ .\\ .\\ &\stackrel{n>a}{=} f\left( \frac{a}{b}-\frac{a+n}{b} \right)\\ &= f\left( -\frac{n}{b}\right)\\ & \blacksquare \blacksquare \end{align*}___________________________________________________________________________________
) _____________________________________________________________________________________ $3.)$ $\ \underline{f(a)=a},\ \forall a\in \mathbb{Z}$ Note that $f(0)=0$. Obviously $f$ is surjective for all rational values, but is injective only for integer values. $A\left(x,a,1\right)=\Longrightarrow \underbrace{f(x+a)=f(f(x)+a))=f(x)+a}_{\spadesuit}\Longrightarrow f(x+1)=f(x)+1$. Now $A\left(\frac{1}{n},-f\left( \frac{1}{n}\right), \underbrace{1-n\cdot f\left( \frac{1}{n}\right)}_{\text{since }b\in \mathbb{N}\Longrightarrow \frac{1}{n}>\cdot f\left( \frac{1}{n}\right)}\right)\Longrightarrow 0=f(0)=f\left( \frac{\frac{1}{n}-f\left( \frac{1}{n}\right)}{1-n\cdot f\left( \frac{1}{n}\right)}\right)=f\left(\frac{1}{n}\right)\ . \ . \ . \ \bigstar \bigstar$ Now assume that for some $\frac{p}{q}\in (0,1)$, such that $k\cdot n+1=q>0$ and $k,n\in \mathbb{N}$, this holds: $$\frac{p}{q}>f\left( \frac{p}{q}\right)\neq 0\ . \ . \ . \ \bigstar \bigstar \bigstar$$ Now note: \begin{align*} f\left(\frac{k}{kn+1}\right)\stackrel{\bigstar \bigstar}{=}f\left(\frac{f\left(\frac{1}{n}\right)+k}{q}\right)&\stackrel{A\left(\frac{1}{n},k,q\right)}{=}f\left( \frac{\frac{1}{n}+k}{q}\right)\\ &=f\left( \frac{1}{n}\right)\\ & \stackrel{\bigstar\bigstar}{=}0,\ \forall k,n\in \mathbb{N}\\ & .\ .\ .\ \clubsuit \end{align*} By Corollary of Chicken Mcnuggets theorem or from lemma used to prove it: we know that since WLOG $\gcd (p,q)=1$, $k=\frac{q-1}{n}$ can be expressed in form $p\cdot u+q\cdot v$ where $u\in \{1,\ ...,\ q-1 \}$ and obviously $v\in \mathbb{Z}^-$(since otherwise $k=pu+qv>p\cdot 1 +q\cdot 1>q=kn+1>k$...), so let $v:=-v$, thus now $v\in \mathbb{Z}^+$. So $f\left( \frac{v}{u} \right)= f \left( \frac{f(j)+v} {u}\right) \stackrel{A(j(\text{such that f(j)=0}),v,u)}{=} f \left( \frac{j+v}{u} \right)\stackrel{u=\frac{k+qv}{p}\text{ and }j=\frac{k}{kn+1}\text{ and }\clubsuit}{=}f\left( \frac{p}{q}\right)\stackrel{\bigstar\bigstar\bigstar}{\neq} 0$, thus we'll always get smaller number in denominator as shown here($q>u$...), thus at some point we'll get in denominator $1$ thus it would be $$f\left( \frac{p}{q}\right)=f\left( \frac{v}{u}\right)=...=f\left(\frac{v_i}{1=u_i}\right)$$which contradicts the way we choose $q$ i.e. $u_j$ for $j\in (1,...,i)$(as of the form $kn+1$ with $k,n\in \mathbb{N})$. Thus $$\text{ when }\frac{p}{q}>f\left( \frac{p}{q}\right),\ q>p\Longrightarrow f\left( \frac{p}{q}\right)=0\ . \ . \ . \ (x)$$, similarly we prove that if $$\frac{p}{q}<f\left( \frac{p}{q}\right),\ q>p\Longrightarrow f\left( \frac{p}{q}\right)=1\ . \ . \ . \ (y)$$. Thus from $$\spadesuit\text{ and }(x)\Longrightarrow f(x)=\lfloor x \rfloor$$, and from $$\spadesuit\text{ and }(y)\Longrightarrow f(x)=\lceil x \rceil$$ __________________________________________________________________________________________ Thus solutions are: $\boxed{f(x)=\text{const.};\ f(x)=\lfloor x \rfloor ;\ f(x)=\lceil x \rceil} $
09.02.2017 13:27
There are three kinds of such functions, which are: all constant functions, the floor function, and the ceiling function. Solution 1. I. We start by verifying that these functions do indeed satisfy (1). This is clear for all constant functions. Now consider any triple px, a, bq P Q ˆ Z ˆ Zą0 and set q “ Y x ` a b ] . This means that q is an integer and bq ď x ` a ă bpq ` 1q. It follows that bq ď txu ` a ă bpq ` 1q holds as well, and thus we have Z txu ` a b ^ “ Y x ` a b ] , meaning that the floor function does indeed satisfy (1). One can check similarly that the ceiling function has the same property. II. Let us now suppose conversely that the function f : Q ÝÑ Z satisfies (1) for all px, a, bq P Q ˆ Z ˆ Zą0. According to the behaviour of the restriction of f to the integers we distinguish two cases. Case 1: There is some m P Z such that fpmq ‰ m. Write fpmq “ C and let η P t´1, `1u and b denote the sign and absolute value of fpmq ´ m, respectively. Given any integer r, we may plug the triple pm, rb ´ C, bq into (1), thus getting fprq “ fpr ´ ηq. Starting with m and using induction in both directions, we deduce from this that the equation fprq “ C holds for all integers r. Now any rational number y can be written in the form y “ p q with pp, qq P ZˆZą0, and substituting pC ´p, p´C, qq into (1) we get fpyq “ fp0q “ C. Thus f is the constant function whose value is always C. Case 2: One has fpmq “ m for all integers m. Note that now the special case b “ 1 of (1) takes a particularly simple form, namely fpxq ` a “ fpx ` aq for all px, aq P Q ˆ Z. (2) Defining f ` 1 2 ˘ “ ω we proceed in three steps. Step A. We show that ω P t0, 1u. If ω ď 0, we may plug ` 1 2 , ´ω, 1 ´ 2ω ˘ into (1), obtaining 0 “ fp0q “ f ` 1 2 ˘ “ ω. In the contrary case ω ě 1 we argue similarly using the triple ` 1 2 , ω ´ 1, 2ω ´ 1 ˘ . Step B. We show that fpxq “ ω for all rational numbers x with 0 ă x ă 1. Assume that this fails and pick some rational number a b P p0, 1q with minimal b such that fp a b q ‰ ω. Obviously, gcdpa, bq “ 1 and b ě 2. If b is even, then a has to be odd and we can substitute ` 1 2 , a´1 2 , b 2 ˘ into (1), which yields f ˆ ω ` pa ´ 1q{2 b{2 ˙ “ f ´a b ¯ ‰ ω. (3) 62 IMO 2013 Colombia Recall that 0 ď pa ´ 1q{2 ă b{2. Thus, in both cases ω “ 0 and ω “ 1, the left-hand part of (3) equals ω either by the minimality of b, or by fpωq “ ω. A contradiction. Thus b has to be odd, so b “ 2k ` 1 for some k ě 1. Applying (1) to ` 1 2 , k, b˘ we get f ˆ ω ` k b ˙ “ f ˆ 1 2 ˙ “ ω. (4) Since a and b are coprime, there exist integers r P t1, 2, . . . , bu and m such that ra ´ mb “ k ` ω. Note that we actually have 1 ď r ă b, since the right hand side is not a multiple of b. If m is negative, then we have ra ´ mb ą b ě k ` ω, which is absurd. Similarly, m ě r leads to ra ´ mb ă br ´ br “ 0, which is likewise impossible; so we must have 0 ď m ď r ´ 1. We finally substitute ` k`ω b , m, r˘ into (1) and use (4) to learn f ´ω ` m r ¯ “ f ´a b ¯ ‰ ω. But as above one may see that the left hand side has to equal ω due to the minimality of b. This contradiction concludes our step B. Step C. Now notice that if ω “ 0, then fpxq “ txu holds for all rational x with 0 ď x ă 1 and hence by (2) this even holds for all rational numbers x. Similarly, if ω “ 1, then fpxq “ rxs holds for all x P Q. Thereby the problem is solved.
03.04.2017 03:02
Answer: constants, $\left\lfloor x \right\rfloor$ and $\left\lceil x \right\rceil$. Clearly these work. Claim: If $f(n) \neq n$ for any integer $n$, then $f$ is constant. Proof. If $m = f(n) \neq n$, then if we let $b = |m-n|$, $x = n$ and $a \equiv -m \pmod b$ vary, we find that $f$ is constant on the integers, say $c$. Then take $a=0$ and $b=1$ for $f(x) = f(f(x)) = c$ (since $f(x) \in {\mathbb Z}$). $\blacksquare$ Hence in the sequel assume $f(n) = n$ for all integers $n$. Then by setting $b=1$ we get \[ f(x+a) = f(f(x)+a) = f(x)+a \qquad \forall x \in {\mathbb Q}, a \in {\mathbb Z}. \] Claim: $f(\frac{1}{2}) \in \{0,1\}$. Proof. For any $a$, we have \[ f\left( \frac{1}{2} \right) = f\left( \frac{\frac{1}{2}+a}{2a+1} \right) = f\left( \frac{f(\frac{1}{2}) + a}{2a+1} \right) \]and so if $f(\frac{1}{2}) \ge 1$ then $a = f(\frac{1}{2})-1$ gives $f(\frac{1}{2}) = 1$. On the other hand if $f(\frac{1}{2}) \le 0$ then $a = -f(\frac{1}{2})$ gives $f(\frac{1}{2}) = 0$. $\blacksquare$ Claim: Assume $f(\frac{1}{2}) = 0$. For $0 < t < n$, $f(t/n) = 0$; equivalently, $f$ is the floor function on fractions with denominator $n$. Proof. Call $n$ good if it has property; so $2$ is good. If $n$ is not prime, then write $n = d_1 d_2$. Assuming $d_1$ and $d_2$ are good and $0 < t/n < 1$, then \[ f\left( \frac tn \right) = f\left( \frac{t/d_1}{d_2} \right) = f\left( \frac{\left\lfloor t/d_1 \right\rfloor}{d_2} \right) = 0. \]In particular, powers of $2$ are good. Now by strong induction; suppose $n = p$ is prime. Then: \begin{align*} f\left( \frac 1p \right) &= f\left( \frac{f(\frac{1}{p-1}) + 1}{p} \right) = f\left( \frac{1}{p-1} \right) = 0 \\ f\left( \frac 2p \right) &= f\left( \frac{f(\frac{2}{p-1}) + 2}{p} \right) = f\left( \frac{2}{p-1} \right) = 0 \\ &\vdots \\ f\left( \frac {p-2}p \right) &= f\left( \frac{f(\frac{p-2}{p-1}) + p-2}{p} \right) = f\left( \frac{p-2}{p-1} \right) = 0. \end{align*}Finally, to get $f(\frac{p-1}{p})$ we write \[ f\left( -\frac{1}{p} \right) = f\left( \frac{f(\frac{1}{2^{p-1}})-1}{p} \right) = f\left( \frac{\text{int}}{2^{p-1}} \right) = -1 \]so adding $1$ finishes the problem. $\blacksquare$ Claim: Assume $f(\frac{1}{2}) = 1$. For $0 < t < n$, $f(t/n) = 1$; equivalently, $f$ is the ceiling function on fractions with denominator $n$. Proof. The same proof works, except in the prime case we use \begin{align*} f\left( \frac 2p \right) &= f\left( \frac{f(\frac{1}{p-1}) + 1}{p} \right) = f\left( \frac{1}{p-1} \right) = 1 \\ f\left( \frac 3p \right) &= f\left( \frac{f(\frac{2}{p-1}) + 2}{p} \right) = f\left( \frac{2}{p-1} \right) = 1 \\ &\vdots \\ f\left( \frac {p-1}p \right) &= f\left( \frac{f(\frac{p-2}{p-1}) + p-2}{p} \right) = f\left( \frac{p-2}{p-1} \right) = 1 \end{align*}and in the last step \[ f\left( \frac{1}{p} \right) = f\left( \frac{f(-\frac{1}{2^{p-1}})+1}{p} \right) = f\left( \frac{\text{int}}{2^{p-1}} \right) = 1 \]to finish. $\blacksquare$
11.04.2017 23:37
Our solutions are $f(x) = c$ for constant $c$, $f(x) = \lfloor x \rfloor$, or $f(x) = \lceil x \rceil$. It is not hard to verify that these are indeed solutions, so now we will prove that these are the only solutions for $f$. Clearly we have \[ f(\frac{a}{b}) = f(\frac{x-f(x) + a}{b}) \]for all $x \in \mathbb{Q}, a \in \mathbb{Z}, b \in \mathbb{Z}_{>0}$. If we let $g(x) = x - f(x)$ and $S \subseteq \mathbb{Q}$ be the range of $g$, we have \[f(\frac{a}{b}) = f(\frac{s+a}{b})\]for all $s \in S$. If $f(n) \not= n$ for some $n \in \mathbb{Z}$, we have $n - f(n) = m$ for some $m \not= 0$. Thus $f(\frac{a}{b}) = f(\frac{a+m}{b})$. (Equivalently, $f(\frac{a}{b}) = f(\frac{a+r}{b})$, where $r = |m|$.) It is easy to see that for any integers $y,z$, we have $f(\frac{y}{b}) = f(\frac{yr}{br}) = f(\frac{zr}{br}) = f(\frac{z}{b})$; thus $f$ is constant. Now assume that $f(n) = n$ for all $n \in \mathbb{Z}$. The key step here is looking at $g(\frac{t}{2})$ for odd $t$; choose odd $h$ such that $g(\frac{t}{2}) = \frac{h}{2}$ for some odd $t$. We want to take advantage of the fact that $f(n) \not= f(n+1)$; if we can find rational $x$ such that $f(n) = f(x) = f(n+1)$, we would have a contradiction. More specifically: \[ n = f(n) = f(\frac{nb_1}{b_1}) = f(\frac{\frac{h}{2} + nb_1}{b_1}) \] \[ n+1 = f(n+1) = f(\frac{(n+1)b_2}{b_2}) = f(\frac{\frac{h}{2} + (n+1)b_2}{b_2}) \] We want to find $b_1, b_2 > 0$ such that $\frac{\frac{h}{2} + nb_1}{b_1} = \frac{\frac{h}{2} + (n+1)b_2}{b_2}$; this would imply $n = n+1$, contradiction. Indeed, this equation is equivalent to \[ \frac{h}{2b_1} = 1 + \frac{h}{2b_2}. \]If $h \ge 3$, we can simply take $b_1 = \frac{h-1}{2}, b_2 = h \cdot \frac{h-1}{2}$ to create a contradiction. Similarly, if $h \le -3$, we can simply take $b_1 = (-h) \cdot \frac{-h-1}{2}, b_2 = \frac{-h-1}{2}$ to create a contradiction. Thus we must have $h = 1$ or $h = -1$; in other words, $g(\frac{t}{2}) = \pm \frac{1}{2}$ for all odd $t$. Suppose both $\frac{1}{2}$ and $-\frac{1}{2}$ are in $S$. We have \[ 0 = f(\frac{0}{1}) = f(\frac{\frac{1}{2} + 0}{1}) = f(\frac{1}{2}) \]but \[ 1 = f(\frac{1}{1}) = f(\frac{-\frac{1}{2} + 1}{1}) = f(\frac{1}{2}), \]implying $0 = 1$, contradiction. Thus we must have $g(\frac{t}{2}) = \frac{1}{2}$ for all odd $t$ or $g(\frac{t}{2}) = -\frac{1}{2}$ for all odd $t$. By considering $f'(x) = -f(-x)$, we can assume that $g(\frac{t}{2}) = \frac{1}{2}$ for all odd $t$. (If $g(\frac{t}{2}) = -\frac{1}{2}$ for all odd $t$, we have $f'(x)$ satisfies the original functional equation but $g'(\frac{t}{2}) = \frac{1}{2}$ for all odd $t$.) Since $g(\frac{t}{2}) = \frac{1}{2}$ for all odd $t$, we have $f(\frac{1}{2}) = 0$. Lemma 1. If $f(x) = 0$, then $x \in S$. Proof. Note that $g(x) = x - f(x) = x$. $\blacksquare$ Lemma 2. If $x \in S$, then $f(x) = 0$. Proof. We have $0 = f(\frac{0}{1}) = f(\frac{x+0}{1}) = f(x)$. $\blacksquare$ Lemma 3. If $f(x) = 0$, then $f(\frac{x}{b}) = 0$ for all $b \ge 1$. Proof. Simply take $a = 0$ in the original functional equation. $\blacksquare$ Corollary. $f(\frac{1}{2b}) = 0$ for all $b \ge 1$. Lemma 4. $f(\frac{i}{2^k})= 0 $ for all $k \ge 1$ and for odd $i < 2^k$. Proof. Obviously we use induction on $k$. The base case is clear, so now we focus on the inductive step. Suppose that for some $k$, $f(\frac{i}{2^k}) = 0$ for all odd $i < 2^k$. By Lemma 3, we have \[f(\frac{i}{2^{k+1}}) = 0.\]Furthermore, we have $\frac{i}{2^k} \in S$ by Lemma 1 and so \[0 = f(\frac{1}{2}) = f(\frac{\frac{i}{2^k}+1}{2}) = f(\frac{i+2^k}{2^{k+1}}). \]Thus $f(\frac{j}{2^{k+1}}) = 0$ for all odd $j < 2^{k+1}$ and the inductive step is proven. $\blacksquare$ Lemma 5. For all rational $r$ with $0 < r < 1$, we have $f(r) = 0$. Proof. Suppose not. First assume that $f(r) \le -1$ for some $0 < r < 1$. We have $g(r) = r - f(r) > 1$; let $g(r) = \frac{x}{y}$ for positive integers $x,y$ with $x > y$. Note that $f(\frac{x}{y}) = 0$ by Lemma 2. We have \[ f(\frac{x}{y}) = f(\frac{\frac{i}{2^k}+x}{y}) = f(\frac{2^k x + i}{2^k y}) \]for all odd $i < 2^k$. Let $y = \beta \cdot 2^{\alpha}$ for odd $\beta$. If we choose $k$ such that $2^k \ge 2\beta$, we see that we can always choose $i = 1,3,5,\cdots, 2\beta - 1$. These are all distinct modulo $\beta$; thus we can choose $i$ such that $\beta$ divides $2^k x + i$. Let $F = \frac{2^k x + i}{2^k y}$. For such $k$ and $i$, $F$ can be expressed as a fraction with denominator a power of two. Furthermore, $F > \frac{x}{y} > 1$. It follows that $F = Z + \frac{j}{2^p}$ for some odd $j < 2^p$ and for some integer $Z \ge 1$. Since $f(F) = 0$ and $f(\frac{j}{2^p}) = 0$, we have $Z = f(\frac{Z}{1}) = f(\frac{\frac{j}{2^p}+Z}{1}) = f(F) = 0$, contradiction. Now assume that $f(r) \ge 1$ for some $0 < r < 1$. We have $g(r) < 0$; letting $g(r) = \frac{-x}{y}$ for positive integers $x,y$, we see that the proof is analogous. $\blacksquare$ Thus we have $f(x) = 0$ for all $0 < x < 1$. For general $x$, write $x = \lfloor x \rfloor + \{ x \}$. We have \[ \lfloor x \rfloor = f(\frac{\lfloor x \rfloor}{1}) = f(\frac{ \{ x \} + \lfloor x \rfloor}{1}) = f(x); \]this is our solution for $f$. The other solution ($f(x) = \lceil x \rceil$) was created when we assumed $g(\frac{t}{2}) = \frac{1}{2}$ for all odd $t$.
16.07.2017 04:26
Quite a hefty functional equation! My solution is a bit different from the above solutions: Step 1: $f(0) \neq 0$ We can substitute $a$ with $a - f(x)$, which is still an integer, so that \[ f \left( \frac{a} {b}\right) = f \left( \frac{x-f(x)+a}{b} \right) \]Letting $f(0) = c$ with $c \neq 0$, plugging in $x = 0$ implies that \[ f \left( \frac{a} {b}\right) = f \left( \frac{a-c}{b} \right) \]Since this holds for all $a \in \mathbb{Z}$, letting $a = c$ implies that $f\left(\frac{c}{b} \right) = c$, letting $a = 2c$ implies $f\left(\frac{2c}{b} \right) = f\left(\frac{c}{b} \right) = c$, so by a simple induction in both the direction of the positive and negative integers, we have that $f\left(\frac{kc}{b} \right) = c$ for all $k \in \mathbb{Z}$ and $b \in \mathbb{Z}_{>0}$. For any rational number $\frac{p} {q}$, if we set $b = q|c|$ and $k = p \cdot sgn(c)$, we have that $\frac {kc} {b} = \frac {p} {q}$, whence we derive $\frac {kc} {b}$ spans all rational numbers, which effectively implies $f$ is a nonzero constant. Step 2: $f(0) = 0$ and there exists $d \in \mathbb{Z}$ with $f(d) \neq d$ Let $f(d) - d = c$, and note $c \in \mathbb{Z}$. Then from \[ f \left( \frac{a} {b}\right) = f \left( \frac{x-f(x)+a}{b} \right) \]if we plug in $x = d$, we obtain that \[ f \left( \frac{a} {b}\right) = f \left( \frac{a-c}{b} \right) \]for all $a \in \mathbb{Z}$ and $b \in \mathbb{Z}_{>0}$. By a simple induction we get that $f\left(\frac{kc}{b} \right) = 0$ for all $k \in \mathbb{Z}$ and $b \in \mathbb{Z}_{>0}$. We have already seen that this implies $f$ is $0$, so our solution set so far is $f$ is any integer constant. Step 3: $f(0) = 0$ and $f(x) = x$ for all $x \in \mathbb{Z}$ We now focus on the statement \[ f \left( \frac{f(x)+a} {b}\right) = f \left( \frac{x+a}{b} \right) \]Setting $b = 1$, $f(f(x) + a)) = f(x+a) = f(x) + a$ since $f(x) + a$ is an integer. Hence it suffices to compute $f$ on the interval $[0, 1)$. We try to find possible values of $f\left(\frac{1}{2} \right)$. Let this value be $c$, and plug in $x = \frac {1}{2}$ and $b = 2a + 1$, for $a$ a nonnegative integer. Then for each $a$, we have \[ f \left( \frac{c+a} {2a+1}\right) = c \]If $\frac {c + a} {2a + 1}$ were an integer, it would mean $\frac {c + a} {2a + 1} = c$, from which $(2a)c = a$, so either $a = 0$ or $c = \frac {1} {2}$. The latter cannot hold, so we now assume $a$ is a positive integer, so $\frac {c + a} {2a + 1}$ is not an integer. Thus for all positive integers $a$, $c \neq (a + 1)$ lest $\frac {c + a} {2a + 1} = 1$. Thus the only nonnegative values of $c$ are possibly $0$ or $1$. We can do a similar thing for negative integers, setting $a = -a'$, $a'$ a positive integer, and therefore $b = -2a + 1$. Following the same argument as above, we obtain that $c \neq (-a' + 1)$ for any positive integer $a'$ greater than $1$, which prohibits any negative values of $c$. In conclusion of this step, $c = 0$ or $c = 1$. Step 4: $c = 0$ We prove by induction that $f\left(\frac{1}{n} \right) = 0$ for all positive integers $n$ greater than $1$. We already have $n = 2$ as a base case, so assume the hypothesis holds for $n = k$. From \[ f \left( \frac{f(x)+a} {b}\right) = f \left( \frac{x+a}{b} \right) \]plug in $x = \frac {1}{k}, a = 1, b = k+1$. Thus we have \[ f \left( \frac{f(\frac {1} {k})+1} {k+1}\right) = f \left( \frac{1}{k} \right) = 0 \]from which $f\left(\frac{1}{k + 1} \right) = 0$. Our induction is therefore complete, and the hypothesis holds. Now we use strong induction to prove that for all positive integers $n$ greater than $1$ and $k < n$, $f\left(\frac{k}{n} \right) = 0$. Indeed, $n = 2$ works as a base case. Now assume the hypothesis holds for all $k < n$ and we try to prove this for $n$. We already know $f\left(\frac{1}{n} \right) = 0$, so $x = \frac {1} {n}$ implies that \[ f \left( \frac{a} {b}\right) = f \left( \frac{\frac{1}{n}+a}{b} \right) \]For $k <n$, we try to set $\frac{\frac{1}{n}+a}{b} = \frac {k} {n}$. This indeed implies $\frac {na +1} {b} = k$. Now, we can assume $gcd(k, n) = 1$ otherwise we are done by the inductive hypothesis. Then $n$ has an inverse $(mod k)$; call it $n'$, with $0<n'<k$, so we can let $a = (k - n')$, with $a$ a positive integer and strictly less than $k$. Thus $b$ is a positive integer. Now, I claim $b < n$. Suppose not, and note that $b = \frac {na + 1} {k} \ge n$. This implies $1 \ge n(k - a)$. But since $a$ is strictly less than $k$, and $n$ is greater than $1$, this inequality cannot hold since $n, k, a$ are positive integers. Thus we obtain a contradiction. I also claim $a < b$. Again, suppose not, and note $na + 1 = kb \ge nb + 1$ whence $(k - n)b \ge 1$. However, $b$ is a positive integer and $k$ is strictly less than $n$. Thus this inequality cannot hold. With this choice of $a$ and $b$, looking back at \[ f \left( \frac{a} {b}\right) = f \left( \frac{\frac{1}{n}+a}{b} \right) \]we get \[ f \left( \frac{a} {b}\right) = f \left( \frac{k}{n} \right) \]But note that $b < n$ is positive and $a < b$ (and if $b = 1$, trivially $a = 0$ so we have $f(0)$), so by the induction hypothesis, the left hand side is $0$. Thus our induction is finally complete, and we have proven the hypothesis. What this really means is that for all rational numbers $x$ in the interval $[0, 1)$, $f(x) = 0$. It is now apparent that $f(x) = \lfloor x \rfloor$. Step 5: $c = 1$ We can follow parallel arguments as in the above step to show $f(x) = \lceil x \rceil$. Step 6: The End! Putting everything together, the solution set is $f(x) = c$ for a integer constant $c$, $f(x) = \lfloor x \rfloor$, or $f(x) = \lceil x \rceil$. It is clear that these solutions do indeed work, so finally, we are done!
03.11.2018 03:46
Here's what I think is a pretty efficient solution. Also, this problem is not number theory Suppose there exists an integer $n$ such that $f\left(n\right)=m\neq n$. Then $x=n$ gives $f\left(\frac{a+m}{b}\right)=f\left(\frac{a+n}{b}\right)$. Letting $c=m-n$, we easily get that $f\left(\frac{p}{q}\right) = f\left(\frac{p+c}{q}\right)$ for all integers $p,q\neq 0$. But now clearly we have $f\left(\frac{p}{q}\right) = f\left(\frac{cp}{cq}\right) = f\left(\frac{cp + c\left(nq -p\right)}{cq}\right) = f\left(n\right)=m$ for all $p,q$, so $f\left(x\right)\equiv m$. Otherwise we have $f\left(n\right)=n$ for all integers $n$. Letting $b=1$ gives $f\left(x+a\right) = f\left(f\left(x\right)+a\right)= f\left(x\right)+a$, so we only need to determine $f$ on an interval of length $1$. Now clearly $f\left(\frac12\right) \neq \frac12$, so we split into two cases, $f\left(\frac12\right)<\frac12$ and $f\left(\frac12\right)>\frac12$. In the first case, $x=\frac12$ and $a=-f\left(\frac12\right), b=1-2f\left(\frac12\right)$ gives $f\left(\frac12\right)=0$. Now if $f\left(\frac1m\right)=0$ for some $m$, then $f\left(\frac1{m+1}\right)=f\left(\frac{f\left(\frac1m\right)+1}{m+1}\right)= f\left(\frac{\frac1m+1}{m+1}\right)=f\left(\frac1m\right)=0$, so by induction we have $f\left(\frac1n\right)=0$ for all $n\ge 2$. Now our goal is to show $f\left(\frac ab\right)=0$ for all $0<a<b$; we'll do this by induction on $a$ with the base case $a=1$ complete. In the inductive step, suppose we want to show $f\left(\frac{a+1}b\right)=0$ for some $a+1<b$. If $a+1\mid b$ then we're done, so write $b=\left(a+1\right)k+l$, where $k,l$ are positive integers with $l<a+1$. Then we have $f\left(\frac a{ak+l}\right) = f\left(\frac{ \frac{a-l}{ak+l}+1}{k+1}\right) = f\left(\frac{f\left(\frac{a-l}{ak+l}\right)+1}{k+1}\right) = f\left(\frac{1}{k+1}\right)=0$, the second-to-last equality coming from the inductive hypothesis, so the inductive step is done and $f\left(x\right)=0$ for all rational $x\in \left(0,1\right)$. From $f\left(x+a\right)=f\left(x\right)+a$ for integers $a$ it follows that $f\left(x\right)=\lfloor x\rfloor$. \left Similarly, if $f\left(\frac12\right)>\frac12$, we can show $f\left(-\frac12\right)=0$, apply the same arguments to show $f\left(-\frac1n\right)=0$ for all $n\ge 2$, and then apply induction on $a$ to show $f\left(-\frac ab\right)=0$ fo rall $0<a<b$; we do the same thing except negating the numerator at each step (the denominator can't be negated because we're restricted to $b>0$.) It then follows that $f\left(x\right)=0$ for all rational $x\in \left(-1,0\right)$, in which case we get $f\left(x\right)=\lceil x\rceil$. In conclusion, the solutions are $\boxed{f\left(x\right)=n, \lfloor x\rfloor, \lceil x\rceil}$ for integers $n$.
17.12.2018 00:48
Particle wrote: This one is a great problem, but sadly, leaked before IMO. Anybody interested can see my solution at FE marathon. (Page 65) How did the problem leak?
27.03.2019 09:59
is there something wrong with this?? because this was very bizarrely straightforward The answer is $f(x) = c, \lfloor x \rfloor, \lceil x \rceil$, which can all be seen to work (in particular, for the latter two just use $x-\lfloor x \rfloor, \lceil x \rceil - x < 1$). We now show that these are the only solutions. Obviously, all constant solutions work, so henceforth assume $f$ is nonconstant. Let $P(x,a,b)$ denote the assertion.
In particular, $P(x,1,1)$ implies $f(x) + 1 = f(x+1)$, so we just look at the interval $x \in [0,1)$.
We now have two cases: If $f(1/2) = 0$, then note that if $f(p/q) = 0$, then $P(p/q, p, q+1)$ implies that $f(p/(q+1)) = f(p/q) = 0$. Thus, there exists an $M$ such that $f(x) = 0$ for either $0 \leq x < M$ or $0 \leq x \leq M$ (i.e. the zeroes are closed downward.) I claim that actually $f(x) = 0$ for $0 \leq x < 1$. Assume not. Then taking $P(M,a,\lceil aM \rceil)$ for large $a$ gives $f(x) = 0$ for $x \not \in (0,M]$, a contradiction. This corresponds to $f(x) = \lfloor x \rfloor$. $\ $ If $f(1/2) = 1$, then note that if $f(p/q) = 1$, then $P(p/q,p,q+1)$ implies that $f((p+1)/(q+1)) = f(p/q) = 1$, so by induction on $q-p$ we actually have $f(x) = 1$ for $1/2 \geq x < 1$. Moreover, $P(2\ell, 0, 2)$ for $1/4 \leq \ell < 1/2$ implies $f(\ell) = 1$ for $\ell \geq 1/4$. Similarly, $P(4\ell, 0, 4)$ for $1/16 \leq \ell < 1/4$ implies $f(\ell) = 1$ for $\ell \geq 1/16$. Continue this to inductively get $f(x) = 1$ for $0 < x \leq 1$. This corresponds to $f(x) = \lceil x \rceil$. We are thus done.
06.07.2019 05:28
Similar to above solutions, posting for storage.
01.01.2020 13:06
Here is a strange solution using inverse modulo. The answers are constant functions $x\mapsto c$, floor function $\lfloor\bullet\rfloor$ and ceiling function $\lceil\bullet\rceil$, which are easily seen to work. The main part is obviously showing that these are all solution. Part A: Getting Foothold This part is the same as most solutions. But I will include it anyway for completeness. Claim: $f(t)=t$ for any $t\in\mathbb{Z}$ otherwise $f$ is constant. Proof: Suppose that there is an integer $t$ such that $f(t) > t$. Replacing $x,a,b$ with $t$, $a(f(t)-t)-t$ and $b(f(t)-t)$ respectively yields $f\left(\tfrac{a+1}{b}\right) = f\left(\tfrac{a}{b}\right)$ for any $a\in\mathbb{Z}$ and $b\in\mathbb{Z}^+$. Easy induction gives $f$ is constant as claimed. The case where $f(t) < t$ for some integer $t$ is analogous. Hence we are done. (In particular, plug in $t$, $a(t-f(t))-t$, $b(t-f(t))$ instead). $\blacksquare$ From now, assume that $f$ is non-constant. Plugging in $b=1$ gives $\boxed{f(x+a) = f(f(x)+a) = f(x)+a}$ for every $x\in\mathbb{Q}$ and $a\in\mathbb{Z}$. Hence it suffices to pin down $f(x)$ for $x\in (0,1)$. Notice that plugging in $a=-f(x)$ gives $\boxed{f(x-f(x))=0}$. Part B: Determining $f\left(\tfrac{1}{2}\right)$ Claim: $f\left(\tfrac{1}{2}\right)\in\{0,1\}$ Proof: Let $k = f\left(\tfrac{1}{2}\right)$. We split into two cases. If $k>0$, then note that $$f\left(\frac{1}{2}-k\right) = 0 \implies f\left(\frac{\frac{1}{2}-k}{2k-1}\right) = f(0)=0$$(by plugging in $(x,a,b) = \left(\tfrac{1}{2}-k, 0, 2k-1\right)$) thus $f\left(-\tfrac{1}{2}\right)=0$ therefore $k=1$. If $k\leq 0$, proceed similarly $$f\left(\frac{1}{2}-k\right) = 0 \implies f\left(\frac{\frac{1}{2}-k}{1-2k}\right) = f(0)=0$$therefore $k=0$. $\blacksquare$ For simplicity, note that $f$ works implies $x\mapsto -f(-x)$ works too. Hence WLOG assume that $f\left(\tfrac{1}{2}\right) = 0$. Part C: The main induction Call a positive integer $t$ tasty if and only if $f\left(\tfrac{n}{t}\right)=0$ for every positive integer $n<t$. Since $f\left(\tfrac{f(x)}{b}\right) = f\left(\tfrac{x}{b}\right)$, we easily deduce that if $t$ is tasty, then its multiple is tasty too. For the sake of contradiction, let $p$ be the minimal non-tasty integer. The previous observation gives $p$ is an odd prime. Claim: $f\left(\tfrac{t}{p}\right) = 0$ for some positivie integer $t<p$. Proof: First we will show that $f\left(\tfrac{1}{p}\right)=0$ (in a contrived way ). Let $k = f\left(\tfrac{1}{p}\right)$ and $T = \tfrac{1}{p} - f\left(\tfrac{1}{p}\right)$. Then $f(T)=0$. Plugging in $x=T$ and $b=p+1$ (which we know that it's tasty since it's even) gives $$f\left(\frac{a}{p+1}\right) = f\left(\frac{ap+1-kp}{p(p+1)}\right)$$Take $a = k+1 \pmod{p+1}$ and let $a = k+1 - (p+1)\ell$. This gives $$0 = f\left(\frac{(p+1)(1-p\ell)}{p(p+1)}\right) = f\left(\frac{1}{p}-\ell\right)$$thus $\ell=k$ which implies $a = 1-pk$. But $a\in [0,p+1)$ therefore $a=1\implies k=1$ as desired. Now here is the climax. Fix any positive integer $t < p$. Let $s\in (0,p)$ be the the unique positive integer such that $p\mid st-1$. Hence $$f\left(\frac{t}{p}\right) = f\left(\frac{f\left(\frac{st}{p}\right)}{s}\right) = f\left(\frac{\tfrac{st-1}{p}}{s}\right)$$Since $s<p$ is tasty and $\tfrac{st-1}{p} < s$, the right hand side is zero. Hence we are done. $\blacksquare$
19.04.2020 00:08
EDIT: As @below gives, the "crucial" bold statement in my solution can't be directly obtained (or maybe it can, but I can't really remember what I was thinking at that time). I'll try to fix this later.
17.05.2020 08:00
math_pi_rate wrote: Note that $f(x)+1 \in \mathbb{Z}$, and so we have $$P(x,1,1) \Rightarrow f(x+1)=f(f(x)+1)=f(x)+1 \quad (\spadesuit)$$This means that if $f(x)=f(y)$ for some rationals $x,y$, then we must have $|x-y|<1$. This observation gives $$P(x,0,1) \Rightarrow f(f(x))=f(x) \Rightarrow |f(x)-x|<1$$ :-( I can’t see why it is true, can you explain please.
12.09.2020 03:16
We claim that the only solutions are $f(x)=c,\lfloor x\rfloor,$ and $\lceil x\rceil$, all three of which can be easily verified. First, let $S_i$ denote the preimage of $i\in\mathbb{Z}$. Note that the problem statement implies that $S_i\pm k$, $\frac{S_i}{k}$ for any $k\in\mathbb N$ is a subset of a (not necessarily distinct) equivalence class. So, if we have two integers $m\neq n$ such that $f(m)=n$, then $m+k,n+k$ are always part of the same equivalence class. So, we can construct an infinite arithmetic sequence with difference $m-n$ which is part of the same equivalence class. Shifting, we get that $k(m-n)$ is part of the same equivalence class as $k$ ranges over the integers. Now, dividing this arithmetic sequence by $m-n$, $f(k)$ is equal to some constant $c$ for any integer. Hence, $\frac{a}{b},\frac{a'}{b}$ are in the same equivalence class for any $a,a',b\neq 0$, but choosing $a'=b$ gives that $f\left(\frac{a}{b}\right)=c$ for any $\frac{a}{b}\in\mathbb{Q}$, and $f$ must be constant. On the other hand, if no such $m,n$ exist, then every integer must be a fixed point. Now, it is clear that, since $i\in S_i$, we must have that $S_i+(j-i)\subseteq S_j$. Likewise, $S_j+(i-j)\subseteq S_i$, so $S_i+(j-i)=S_j$ for any $i,j\in\mathbb{Z}$. So, all the $S_i$ are integer shifts of each other. In particular, this means that every fractional part occurs in each $S_i$ exactly once. This means that there exists $\frac{k}{2}\in S_0$ for some $k$. As $0\in S_0$, $\frac{S_0}{|k|}\subseteq S_0$, so the unique number with fractional part $\frac{1}{2}$ in $S_0$ is $\pm\frac{1}{2}$. From here, we will show that $\frac{1}{2}\in S_0$ implies $f(x)=\lfloor x\rfloor$. The following can easily be adapted in the other case to recover the solution $f(x)=\lceil x\rceil$. We first prove with induction on $n$ that $\frac{i}{n}\in S_0$ for every $1\le i<n$. We have already proved the result for $n=1$. Case 1: $n$ is not prime Suppose that $n=n'p$ for some prime $p$. Then, we already know that the result holds true for $n'$. In particular, this means that $\frac{S_i}{n'}\subseteq S_0$ for any $0\le i<n'$. However, by inductive hypothesis, we also know that $\frac{i}{p}\in S_{\lfloor i/p\rfloor}$ for any $i$, so $S_0\cup S_1\cup\ldots\cup S_{n'-1}$ has all $\frac{i}{p}$ for $1\le i<n-1$, and $\frac{S_0\cup\ldots\cup S_{n'-1}}{n'}\subseteq S_0$ must have all $\frac{j}{n}$ for $1\le j<n-1$ as desired. Case 2: n is prime First, we show that $\frac{1}{n}\in S_0$. Supposing the contrary, this means that $-\frac{1}{n}\in S_0\implies\frac{n-1}{n}\in S_1$, so $\frac{(n-1)/2}{n}\in S_0$. Dividing by $(n-1)/2$, we get $\frac{1}{n}\in S_0$, as desired. Now, consider a primitive root $\zeta$ of $n$. We claim that if $\frac{k}{n}\in S_0$ for $1\le k<n$, then so is $\frac{r(k\zeta^{-1})}{n}$, where $r(x)$ denotes the remainder of $x$ mod $n$. To show this, note that there exists a unique $N<\zeta$ such that $\zeta|k+Nn$, since $\gcd(\zeta,n)=1$. Taking this $N$, we find that $\frac{k+Nn}{n}\in S_N$. However, remember that $\frac{N}{\zeta}\in S_0$ by inductive hypothesis, so $\frac{S_N}{\zeta}\subseteq S_0$. Therefore, $\frac{(k+Nn)/\zeta}{n}\in S_0$. We have that $0\le \frac{(k+Nn)}{\zeta}<n$, and it leaves residue $k\zeta^{-1}\pmod n$, so this is just $\frac{r(k\zeta^{-1})}{n}$, as desired. Since we already have $\frac{1}{n}\in S_0$, we can just iteratively apply this claim to get that $\frac{r(\zeta^{-j})}{n}\in S_0$ for any $j$. As $\zeta^{-1}$ is a primitive root, the numerator ranges over all residues, and the induction is complete. To finish, this means that all rationals in the range $[0,1)$ are in $S_0$, and remember that $S_i=S_0+i$ for all integers. Hence, we get $f(x)=\lfloor x\rfloor$, as desired. The other case gives $\lceil x\rceil$, so $f$ can only be one of the three aforementioned solutions.
11.10.2020 11:57
The answer is constants, \(f(x)\equiv\lfloor x\rfloor\), and \(f(x)\equiv\lceil x\rceil\), which work. We now prove these are the only solutions. In what follows, we will assume \(f\) is not constant. Let \(P(x,a,b)\) denote the assertion, and let \(S\) denote the set of all values of \(f(x)-x\). By \(P(x,a-f(x),b)\), with \(s=x-f(x)\), we have \[\boxed{f\left(\frac ab\right)=f\left(\frac{a+s}b\right)}\]for all \(a\in\mathbb Z\), \(b\in\mathbb Z_{>0}\), \(s\in S\). Call this assertion \(Q(s,a,b)\). Claim: \(f(n)=n\) for all integers \(n\). Furthermore, \(f(n+s)=n\) for all \(s\in S\). Proof. Otherwise for some \(n\), \(n-f(n)\ne0\) is a nonzero integer \(m\in S\), so by \(Q(m,am,bm)\), \[f\left(\frac ab\right)=f\left(\frac{am}{bm}\right)=f\left(\frac{am+m}{bm}\right)=f\left(\frac{a+1}b\right).\]It is easy to show \(f\) is constant from here, contradiction. Then \(Q(s,n,1)\) gives \(n=f(n)=f(n+s)\) for all \(s\in S\). (Also observe that if \(f(n+s)=n\) for some \(n\), then \(s\in S\).) \(\blacksquare\) Claim: If \(s\in S\), then for all positive integers \(b\), we also have \(s/b\in S\). Proof. By \(Q(s,bn,b)\), we have \[n=f(n)=f\left(n+\frac sb\right),\]so \(x=n+s/b\) obeys \(x-f(x)=s/b\). \(\blacksquare\) Note that for some odd integer \(k\), \[\frac k2=\frac12-f\left(\frac12\right)\in S.\]By Claim 2, either \(1/2\in S\) or \(-1/2\in S\). In the former case, \(f(1/2)=0\) and in the latter case, \(f(-1/2)=0\). Since \(f\) is a solution if and only if \(x\mapsto-f(-x)\) is a solution, we may assume without loss of generality we are in the \(1/2\in S\) case. We will show that \(f(x)\equiv\lfloor x\rfloor\). Claim: [Main induction] \(f(x)=0\) for all \(0<x<1\). (Equivalently, \(x\in S\) for all \(0<x<1\).) Proof. We will show by induction on \(q\) that \(f(p/q)=0\) for all \(0<p<q\). Assume the hypothesis holds for all positive integers less than \(q\). If \(\gcd(p,q)\ne1\), we already know \(f(p/q)=0\), so assume \(\gcd(p,q)=1\). For \(p\le q-2\), let \(0<r<q\) satisfy \(pr\equiv-1\pmod q\). We can check \(r\ge2\) and \(\frac{pr+1}q<r\), so since \(\frac1r\in S\), \[f\left(\frac pq\right)=f\left(\frac{p+\frac1r}q\right)=f\left(\frac{\frac{pr+1}q}r\right)=0.\] For \(p=q-1\), the above argument no longer works, since \(r\) would be 1. However, an easy fix is to run the above argument in reverse; note that \(\frac1q\in S\), so \[f\left(\frac{q-1}q\right)=f\left(\frac{(q-2)+\frac1q}{q-1}\right)=f\left(\frac{q-2}{q-1}\right)=0.\] \(\blacksquare\) The proof is basically complete. Combining Claim 1 and Claim 3, we have \(f(n+s)=n\) for all integers \(n\) and \(0\le s<1\), as needed.
08.01.2021 16:27
The answer is $f(x)=c$ for some $c\in\mathbb Z$, $f(x)=\lfloor x\rfloor$and $f(x)=\lceil x\rceil$. Obviously the constant function works, we now show that the ceiling function works as well. Indeed, suppose on the contrary that there exists some integers $c$ such that $$\frac{\lceil x\rceil +a}{b}>c\geq \frac{x+a}{b}$$then we must have $\lceil x\rceil +a\geq bc+1\geq x+a+1$, hence $\lceil x\rceil \geq x+1$, contradiction. Similarly the floor function works as well. We now show that they are the only ones. Label the equation $$f\left(\frac{f(x)+a}{b}\right)=f\left(\frac{x+a}{b}\right)\hspace{20pt}(1)$$Denote $$S=\{f(x)-x:x\in \mathbb Z\}$$Case I: $S$ has a nonzero element $s$. Substitute $b=1$ in $(1)$ then $f(f(x)+a)=f(x+a)$, hence $s$ is a period of $f$ over $\mathbb Z$. In particular, if $n$ is an integer, then $$f(n)=f\left(\frac{sn}{s}\right)=f\left(\frac{f(sn)}{s}\right)=f\left(\frac{f(s(n+1))}{s}\right)=f\left(\frac{s(n+1)}{s}\right)=f(n+1)$$Hence $f$ is constant on $\mathbb Z$. Now, take $a=0,b=1$ in $(1)$, we have $f(f(x))=f(x)$, hence for all $x\in\mathbb Q$, $f(x)$ is a fixed point, hence $f$ is constant over $\mathbb Q$. Case II: $S=\{0\}$ Then $f(x)=x$ for all $x\in\mathbb Z$, taking $b=1$ in $(1)$, we have $$f(x+a)=f(f(x)+a)=f(x)+a\hspace{20pt}(2)$$We divide into two subcases: Case IIa: $f(\frac{1}{2})>0$ Claim. $f(\frac{a}{b})=0$ for all $0<a<b$. Proof. We proceed by induction on $n$. For the base case $b=2$, let $f(\frac{1}{2})=k$, then letting $a=1-k, b=2k-1, x=\frac{1}{2}$ in $(1)$ we have $f(\frac{1}{2})=f(1)=1$, hence $k=0$ by $(2)$. Now suppose all smaller cases hold, we consider the case $b=n$. Suppose $n$ is not a prime and $k|n$ where $k\neq 1,n$. Then, $$f\left(\frac{a}{k}\right)=f\left(\left\lceil \frac{a}{k}\right\rceil\right)$$Hence $$f\left(\frac{a}{n}\right)=f\left(\frac{k}{n}\cdot\left\lceil\frac{a}{k}\right\rceil\right)=1$$by inductive hypothesis since $k\cdot\left\lceil\frac{a}{k}\right\rceil\leq k\cdot\frac{n}{k}=n$ Otherwise, if $n$ is prime and $a\neq 1$, there exists some $1\leq m\leq n-1$ such that $n|(a-1)m+1$, then $$f\left(\frac{1+(a-1)}{n}\right)=f\left(\frac{\frac{1}{m}+a-1}{n}\right)=f\left(\frac{(a-1)m+1}{nm}\right)=1$$by inductive hypothesis. If $a=1$, then substitute $x=\frac{1}{2}, a=\frac{n-1}{2}, b=a(1+n)$ in $(1)$ we have $$f\left(\frac{1}{n}\right)=f\left(\frac{1}{n+1}\right)=1$$$\blacksquare$ Hence $f(x)=\lceil x\rceil$ by $(2)$ Case IIb: $f(\frac{1}{2})\leq 0$. Very similar to the previous case: Claim. $f(\frac{a}{b})=0$ for all $0<a<b$. Proof. We proceed by induction on $n$. For the base case $b=2$, let $f(\frac{1}{2})=k$, then letting $a=1-k, b=1-2k, x=\frac{1}{2}$ in $(1)$ we have $f(-\frac{1}{2})=f(-1)=-1$, hence $k=0$ by $(2)$. Now suppose all smaller cases hold, we consider the case $n$. Suppose $n$ is not a prime and $k|n$ where $k\neq 1,n$. Then, $$f\left(\frac{a}{k}\right)=f\left(\left\lfloor \frac{a}{k}\right\rfloor\right)$$Hence $$f\left(\frac{a}{n}\right)=f\left(\frac{k}{n}\cdot\left\lfloor\frac{a}{k}\right\rfloor\right)=1$$by inductive hypothesis since $k\cdot\left\lfloor\frac{a}{k}\right\rfloor< k\cdot\frac{n}{k}=n$ Otherwise, if $n$ is prime and $a\neq 1$, there exists some $1\leq m\leq n-1$ such that $n|(a-1)m+1$, then $$f\left(\frac{a}{n}\right)=f\left(\frac{\frac{1}{m}+a-1}{n}\right)=f\left(\frac{am+1}{nm}\right)=1$$by inductive hypothesis. Hence $f(x)=\lfloor x\rfloor$ as desired.
16.01.2021 23:31
This is surprisingly very detail-oriented for an N6. For storage: Let $P(x,a,b)$ denote the original expression. Throughout the solution, $n$ will always represent an integer. Clearly $$\boxed{f(x)=c \ \ \forall x \in \mathbb{Q}}$$works for any integer $c$, so assume $f$ is non-constant from now on. Claim 1: $f(n)=n$ for all $n$. Proof: Assume $f(n) \neq n$ for some $n$. Then $P(n,-f(n)+a,b)$ gives $$f \left( \frac{a}{b} \right) = f \left( \frac{n-f(n)+a}{b} \right)$$Applying this repeatedly, we get $$f \left( \frac{a}{b} \right)=f \left( \frac{a+k(n-f(n))}{b} \right)$$for all positive integers $k$. It is easy to conclude that $f$ must be constant (for instance, first putting $a=0$ to get constancy over one side of the rationals, and then using a large $k$ in the general equation), contradiction! $\blacksquare$ Let $S=f^{-1}(0)$. It is trivial to see that $S$ contains a non-zero number. Claim 2: $f(x)=n$ $\iff$ $x-n \in S$. Proof: Follows from $P(x,-n,1)$ and Claim 1. $\blacksquare$ Corollary 2.1: For every $x$ there is a unique $n$ such that $x-n \in S$. Thus, it is sufficient to determine $S$. Claim 3: $S$ is an interval containing $0$. Proof: Let $r \in S$ with $r \neq 0$ and write $r=\dfrac{p}{q}$ in the lowest terms with $q>0$. Then $P(r,kp,kq+1)$ gives $$\frac{kp}{kq+1} \in S$$for any positive integer $k$. Applying this repeatedly, we get $$\frac{kp}{kq+l} \in S$$for any positive integers $k,l$. Since any rational $x$ having same sign as $r$ and $|x|<|r|$ can be written in the above form, we get the required claim. $\blacksquare$ By Corollary 2.1, $S$ must have length $1$. Looking at the endpoints, we see that $S$ must be half-open. Claim 4: $0$ is an endpoint of $S$. Proof: Assume the contrary. Then $(-r,1-r) \subseteq S$ for some positive rational $r=\dfrac{p}{q}<1$, written in the lowest form (one of the ends will be closed, so $S=[-r,1-r)$ or $(-r,1-r]$ ). Clearly $$0<q-p-r<q(1-r)=q-p$$Choose any $x \in (q-p-r,q(1-r))$. Then by Claim 1, $f(x)=q-p$, and it is easy to see that $f \left( \frac{x}{q} \right)=0$. But then $P(x,0,q)$ gives $f(1-r)=0$. Similarly we have $$0>-p+1-r>-rq=-p$$Choose any $y \in (-rq,-p+1-r)$. Then by Claim 1, $f(y)=-p$, and it is easy to see that $f \left( \dfrac{y}{q} \right)=0$. But then $P(y,0,q)$ gives $f(-r)=0$. $$\implies \ f(-r)=f(1-r)=0$$Contradiction since $S$ is half-open! $\blacksquare$ $0 \in S$ by Claim 1, so $S$ must be closed at $0$. We have two cases: Case I: $S=[0,1)$ In this case, we get the solution $$\boxed{f(x)= \lfloor x \rfloor \ \ \forall x \in \mathbb{Q}}$$ Case II: $S=(-1,0]$ In this case, we get the solution $$\boxed{f(x)= \lceil x \rceil \ \ \forall x \in \mathbb{Q}}$$ $\blacksquare$
08.02.2021 19:46
The only functions are constant functions, $f(x)\equiv \lfloor x \rfloor, f(x)\equiv \lceil x \rceil$. They clearly work. Now I show they're the only ones. Assume $f$ is nonconstant. Claim: $f(x)=x\forall x\in \mathbb{Z}.$ Proof. Suppose $f(x)-x>0$. Then, $P(x, bk-x, f(x)-x)$ yields $f(x)=c\forall x\in \mathbb{Z}$. Now, for $x\in\mathbb{Z}, P(x,a,b), P(x+1,a,b)$ yields $$f(\frac{x+a}{b})=f(\frac{c+a}{b})=f(\frac{x+1+a}{b})$$ Therefore, $f(k)=f(k+\frac{1}{b})=f(k+\frac 2b) =\cdots =f(k+1)=c$, so $f$ is a constant function, contradiction. Claim: $f(x+1)-f(x)=1$. Proof. $P(x,1,1)$ gives $f(f(x)+1)=f(x+1)$. Since $f(x)+1\in\mathbb{Z}, f(x)+1=f(x+1)$. Let $S=\{ x: f(x)=0\}$ Suppose $x \in S$, then $P(x,0,b)$ yields $f(\frac xb)=0$ if $b\in \mathbb{N} (1).$ Also, if $\frac pq, \frac ab\in S, P(\frac pq, a,b)$ yields $$f(\frac{p+aq}{bq})=f(\frac{\frac pq + a}{b})=0$$ WLOG, $f(\frac 12)=0.$ If $f(\frac{2k+1}{2})=0,$ we can obtain $f(\frac 12)=-k,$ but also $f(\frac 12)=0$ by (1). Similar logic applies for $f(\frac{-2k-1}{2})$. Claim: $f(\frac 1p)=0$ for all primes $p$. We proceed by induction on $p$. Base Case: $p=2, $ clear. Inductive Step: Assume for all smaller primes $q<p$ this is true, I will show this is true for $q=p.$ If $f(\frac 1p)<0$, we can easily get a contradiction. Therefore, for some $k\in \mathbb{Z}, f(\frac{1-kp}{p})=0$. This implies $f(\frac{-1}{p})=0.$ Since $f(\frac 12)=0, f(\frac{\frac{-1}{p}+1}{2})=f(\frac{p-1}{2p})=0$, which suggests $f(\frac 1p)=0.$ We use induction to prove that $f(\frac kp)=0$ for all $1\le k<p.$ The base case, $k=1$ has already been established. If $f(\frac kp)=0, P(\frac kp,1,b) $ gives $f(\frac{\frac kp +1 }{b})=0$. In other words, $f(\frac{\frac{p+x}{b}}{p})=0 \forall 1\le x\le k.$ We can easily see $k+1\mid $ one of $p+1,\cdots,p+k-1,p+k$, so picking one of them would complete the induction. I now show that $f(x)=0\forall 0\le x<1.$ Let $x=\frac mn,$ and we strong induct on $m$. Suppose $\nu_p(m)<\nu_p(n).$ Since I can make $(m,n)=1,$ it follows that $p\nmid m.$ Let $m=qm'+r$ for $0\le r<p$. By Inductive hypothesis, $f(\frac{m'}{\frac np})=0$ because $m'<\frac mp<\frac np$. Since $f(\frac rp)=0, f(\frac mn)=f(\frac{\frac rp+m'}{\frac np})=0$ This would imply $f(x)=\lfloor x \rfloor.$ There is an alternate case where $f(-\frac 12)=0$, and we repeat the same argument on $f(-x)$ to show that $f(x)=\lceil x \rceil$
30.12.2021 06:22
I have a different proof that $f\left(\tfrac{1}{2}\right) \in \{0,1\}$. By $P\left(\tfrac{1}{2},n,2n+1\right)$ for any positive integer $n$, we obtain \[f\left(\frac{f(1/2)+n}{2n+1}\right)=f\left(\frac{1/2+n}{2n+1}\right)=f\left(\frac{1}{2}\right).\]If $\tfrac{f(1/2)+n}{2n+1}$ is an integer, then \[\frac{f(1/2)+n}{2n+1}=f\left(\frac{1}{2}\right),\]which means $f\left(\tfrac{1}{2}\right)=\tfrac{1}{2}$, a contradiction. Thus, $\tfrac{f(1/2)+n}{2n+1}$ is not an integer, so $f\left(\tfrac{1}{2}\right) \not\equiv n+1 \pmod{2n+1}$, which means $2n+1 \nmid 2f\left(\tfrac{1}{2}\right)-1$. Since $2f\left(\tfrac{1}{2}\right)-1$ is not divisible by any odd number greater than $1$, it must be in the form $\pm 2^k$ for a nonnegative integer $k$. The only values that work are $f\left(\tfrac{1}{2}\right)=0$ and $f\left(\tfrac{1}{2}\right)=1$.
30.12.2021 13:28
A closely related article: P. Eisele and K. P. Hadeler Game of Cards, Dynamical Systems, and a Characterization of the Floor and Ceiling Functions American Mathematical Monthly 97, (1990), pp. 466-477 https://doi.org/10.2307/2323829
28.01.2022 01:31
18.03.2022 01:51
Solved with Jeffrey Chen and Rich Wang. The only solutions are $f(x) = c$ for $c$ constant, $f(x) = \lfloor x\rfloor x$, or $f(x) = \lceil x \rceil$. Denote $P(x,a,b)$ as the expression given. First, we will show that, for $x$ integers, we either have $f(x) = x$ or $f(x) = c$ for constant $c$. Assume $f(x)\neq x$ for all $x$, then there exists some $x$ s.t. $f(x) - x = t$ for some integer $t \neq 0$. Now, by $P(x,a,1)$, we have \[f(f(x) + a) = f(x + a) \Rightarrow f(a + t) = f(t)\]for some integer $t$. Now, this means if $m\equiv n\mod t$, then $f(m) = f(n)$. We have two cases: Case 1: $f(0) \neq 0$. Then, we have \[P(0,kf(0), |f(0)|) \Rightarrow f(k + 1) = f(k) \text{ or } f(-(k+1)) = f(-k)\]This means $f$ is constant. Case 2: $f(0) = 0$. Now, we have \[P(k|t|, 0, |t|) \Rightarrow f(\frac{0}{|t|}) = f(k) \Rightarrow f(k) = 0\]Therefore, for both cases, we have $f$ is constant for $x\in \mathbb{Z}$ If $f(x) = c$ for constant $c$ and integer $x$, then \[P(x,-c, b), x\in Z \Rightarrow c = f(\frac{0}{b}) = f(\frac{x-c}{b})\]therefore for all $x\in \mathbb{Q}$, we have $f(x) = c$. Now, if $f(x) = x$ for $x\in \mathbb{Z}$, I claim $f(\frac12) = 0$ or $f(\frac12) = 1$. Consider taking $P(x, kb - f(x), b)$ for integer $k$. We get \[k = f(\frac{kb}{b}) = f(\frac{kb + x - f(x)}{b}) = f(k + \frac{x-f(x)}{b})\]Now, if we plug in $x = \frac{1}{2}$, and let $x - f(x) = \frac{p}{2}$ for some odd integer $p$, I claim $p = \pm 1$. If $p\neq \pm 1$, then \[k = f(k + \frac{\frac{p}{2}}{|p|}) = f(k \pm \frac12), k = f(k + \frac{p}{2})\]However, this would mean $k = k + \frac{p-1}{2}$ or $k = k + \frac{p + 1}{2}$, which is a contradiction. We have $p = \pm 1$. By $P(x,a,1)$, we have $f(x) + a = f(f(x) + a) = f(x+a)$, so for all $x\in \mathbb{Z}$, we have $f(x + \frac12) - (x + \frac12) = f(\frac12) - \frac12$. $\newline$ We now know that we must either have $f\left(\frac{1}{2}\right)=0$ or $1$. Now we claim that all fractions between $0$ and $1$ must also equal $f\left(\frac{1}{2}\right)$. Say that $f\left(\frac{1}{2}\right)=k$, and say for the sake of contradiction that some fraction $\frac{m}{n}$ between $0$ and $1$ with smallest $n$ and smallest $m$ (priority on smallest $n$) does not equal $k$. $\newline$ Case 1: $n$ is even. $\newline$ In this case, notice that $m$ will be odd and $n$ will be even. Plugging in $x=\frac{1}{2},a=\frac{m-1}{2},b=\frac{n}{2}$ into the original FE gets us $$f\left(\frac{k+\left(\frac{m-1}{2}\right)}{\frac{n}{2}}\right)=f\left(\frac{m}{n}\right).$$But this is a contradiction, as by minimality of $n$ the left hand side must equal $k$, whereas by our contradictive assumption the right hand side does not. $\newline$ Case 2: $n$ is odd. Because $n$ is odd, we can set $n=2r+1$. $\newline$ Plugging in $x=\frac{1}{2},a=r,b=n$ into the original FE gets us $$f\left(\frac{k+r}{n}\right)=f\left(\frac{2r+1}{2n}\right)=f\left(\frac{1}{2}\right)=k.$$But now, if we plug in $x=\frac{k+r}{n},$ and take $a$ and $b$ solutions to $$\frac{\frac{k+r}{n}+a}{b}=\frac{m}{n}\implies k+r=bm-an,$$from which there exists always exists an integer solution for $a$ and $b$ by Bezout's Lemma, as $\gcd(m,n)=1$, and $b<n$, then we get $$f\left(\frac{k+a}{b}\right)=f\left(\frac{\frac{k+r}{n}+a}{b}\right)=f\left(\frac{m}{n}\right).$$From which we have a contradiction, as the left hand side must equal $k$ by minimality of $n$, and the right hand side cannot equal $k$ by our contradictive assumption. $\newline$ At this point, we have that $f(x)=k$ for all rational numbers $x$ for $0<x<1$. One can easily generalize to all other intervals by plugging in $x$. $\square$
08.06.2022 16:51
A. $\exists x\in \mathbb{Z}: f(x)\neq x:$ Then let $f(x)=y>x$ and let $z=y-x.$ Now $P(x,\gamma z-y,z)$ implies $f(\gamma +1)=f(\gamma)=f(\gamma -1).$ Now just induct to get $f(\gamma)=y$ for $\gamma \in \mathbb{Z}.$ Moreover $P(x,0,1)$ implies $y=f(x)=f(f(x)).$ So $f$ is constant in $\mathbb{Q}$ as well. B. $\forall x\in \mathbb{Z}: f(x)=x:$ Then $P(x,y,1)$ gives $f(x)+y=f(x+y).$ If $f(1/2)\leq 0$ then $P(1/2,-f(1/2),1-2f(1/2))$ yields $f(1/2)=0.$ Otherwise $P(1/2,f(1/2)-1,2f(1/2)-1)$ yields $f(1/2)=1.$ WLOG $f(1/2)=0.$ Claim: $f(\tfrac{1}{k})=0$ $\forall k\geq 2.$ Proof. We induct. Base case $k=2$ is true. Assume it's true for $k-1.$ But then $f(\tfrac{1}{k})=f(\tfrac{f(\tfrac{1}{k-1})+1}{k})=f(\tfrac{\tfrac{1}{k-1}+1}{k})=f(\tfrac{1}{k-1})=0.$ Q.E.D. $\blacksquare$ Let $k>m$ and $mn\equiv 1\pmod{k}$ where $0<n<k.$ We have $f(\tfrac{m}{k})=f(\tfrac{f(\tfrac{mn}{k})}{n})=f(\tfrac{\tfrac{mn-1}{k}}{n})=0.$ So $f(x)=\lfloor x\rfloor,$ works. And $f(\tfrac{1}{2})=1$ gives $f(x)=\lceil x\rceil,$ which works. We are done exhausting case-work.
22.10.2022 00:39
First, solve over integers to yield $f(x)$ is either periodic or equal to $x$. Consider the later case: We can solve over half-integers to yield $f(x) = \lfloor x \rfloor$ or $f(x) = \lceil x \rceil$. This is by taking $(a, b) = (a, 2a+1)$ where $2a + 1 \mid 2c - 1$ gives contradiction for $c \neq 0, 1$ since $2a + 1$ will be positive and $a \neq 0$ in those cases and we have $a = 2ac$ but $c \neq \frac{1}{2}$. We can generalize via induction on the denominator by taking $(a, b) = (0, n - 1)$ to get in the floor case: $\left \lfloor{ \frac{f(\frac{n-1}{n})}{n-1}} \right \rfloor = f \left (\frac{1}{n} \right )$ and $(a, b) = (n - 2, n - 1)$ to yield $\left \lfloor \frac{f(\frac{1}{n}) + n - 2}{n^2} \right \rfloor = f \left(\frac{1}{n} \right)$, so the only solution is $f \left(\frac{k}{n} \right)$ for all $0 \leq k < n$ is $0$ to match the $f(x) = \lfloor x \rfloor$ hypothesis. The ceiling case is identical. Thus by induction, we are done for all numbers in the done. In the first case where the function is periodic over the integers with period $c$, simply notice $f \left( \frac{x+c+a}{b} \right) = f \left( \frac{f(x+c)+a}{b} \right) = f \left( \frac{f(x) + a}{b} \right) = f \left(\frac{x + a}{b} \right)$ simply use $a = kc - x$ and $b = cs$ for all $k \in \mathbb{Z}, s \in \mathbb{Z}_{>0}$, then $f \left(\frac{k}{s} \right) = f \left(\frac{k+1}{s} \right)$ so $f$ is constant. Thus we have all solutions: $f(x) = \lfloor x \rfloor, \lceil x \rceil, c$ for $c \in \mathbb{Z}$.
19.03.2023 16:31
The only solutions are $f\equiv c$, $f(x) = \lfloor x \rfloor$, $f(x) = \lceil x \rceil$, where $c$ is an integer constant. These work. Now we prove they are the only solutions. Clearly constant solutions work. Now assume $f$ is nonconstant. Claim: $f(x) = x$ for all integers $x$. Proof: Suppose there existed an integer $n$ such that $f(n)\ne n$. We have \[f\left(\frac{a + f(n)}{b}\right) = f\left(\frac{a+n}{b}\right)\] Thus, $f\left(\frac{a}{b}\right) = f\left(\frac{a+k}{b}\right) = f\left(\frac{a-k}{b}\right)$, where $k = |n - f(n)|$. This gives that $f(0) = f(kx/b)$ for any integer $x$. This can take any rational value, so $f$ is constant, contradiction. $\square$ Setting $b=1$ in the equation gives \[f(x+a) = f(f(x) + a) = f(x) + a\]for all rationals $x$ and integers $a$. Setting $a = -f(x)$ gives $f(x - f(x)) = 0$. Claim: Either $f(1/2)= 0$ or $f(-1/2) = 0$. Proof: Let $1/2 - f(1/2) = k/2$. We have $f(k/2) = 0$. If $k$ is positive, then setting $x = k/2, a = 0, b = k$ gives $0 = f(1/2)$. If $k$ is negative, then setting $x = - k/2, a=0,b=k$, gives $0 = f(-1/2)$. $\square$ Notice that $f(x)$ iff $-f(-x)$ works, so WLOG assume that $f(1/2) = 0$. Since $\lceil x \rceil = -\lfloor -x \rfloor$, we will show that $f(x) = \lfloor x \rfloor$. We go by induction on the denominator. We only care about rationals in the interval $[0,1)$ because $f(x+1) = f(x) + 1$. The base case $2$ is obvious. Now suppose it was true for all denominators less than $q$ for some $q$. We show that $f(p/q) = 0$ for all positive integers $p<q$, which will finish. We may assume $\gcd(p,q) = 1$. If $p <q-1$, then let $m$ such that $pm \equiv -1\pmod q$. Setting $x = 1/m, a = p, b = q$ in the original FE. This gives \[f\left(\frac{p}{q}\right) = f\left(\frac{pm + 1}{mq}\right) = 0\]because $pm + 1 < mq$ and the denominator of the simplified $\frac{pm + 1}{mq}$ is less than $q$. If $p = q-1$, then set $ x= (q-2)/q, a = 1, b = 2$. Since $f((q-2)/q) = 0$, we have \[0 = f(1/2) = f((2q-2)/2q) = f((q-1)/q),\]as desired. Therefore the induction is complete, so $f(x) = 0$ for all $x\in [0,1)$. Since $f(x+1) = f(x) + 1$, $f(x) = \lfloor x \rfloor$.
20.04.2023 23:54
Wow, probably my hardest solve so far!
06.05.2023 09:25
Denote the assertion with $P(x, a, b)$. Note that constant functions $f$ work. Suppose that $f$ is nonconstant from here on. Claim: $f$ is the identity only on the integers. Proof. Suppose that $f(n) \ne n$ for some integer $n$. Then, $P(n, a(f(n)-n) - n, b(f(n)-n))$ implies that \[ f\left(\frac{a + 1}{b}\right) = f\left(\frac{a}{b}\right) \]which implies equality between all rationals, contradictions. Furthermore, $f$ must be the identity on nonrationals. $\blacksquare$ By $P(x, a, 1)$, it follows that \[ f(x) + a = f(f(x)) + a = f(f(x) + a) = f(x + a) \]as $f$ is idempotent. Claim: Either $f\left(\frac{1}{2}\right) = 0$ or $f\left(\frac{1}{2}\right) = 1$. Proof. Suppose that $f\left(\frac{1}{2}\right) \ge 2$ Then, by $P\left(\frac{1}{2}, f\left(\frac{1}{2}\right) - 1, 2f\left(\frac{1}{2}\right) - 1\right)$, it follows that \[ f(1) = f\left(\frac{1}{2}\right) \]so $f\left(\frac{1}{2}\right) = 1$, contradiction. Similarily we can rule out $f\left(\frac{1}{2}\right) < 0$ with $P\left(\frac{1}{2}, f\left(\frac{1}{2}\right), 1 - 2f\left(\frac{1}{2}\right)\right)$. $\blacksquare$ We now solve \[ f\left(\frac{a}{b}\right) = f\left(\frac{a + \frac{1}{2}}{b}\right) \]and $f\left(\frac{1}{2}\right) = 0$ over the range $[0, 1]$ as we can flip in the other case. Claim: $f\left(\frac1n\right) = 0$ and $f\left(\frac{n-1}{n}\right) = 0$ holds for integers $n \ge 2$. Proof. We claim this inductively on $n$. If $f\left(\frac1n\right) = 0$, then by $P\left(\frac1n, 1, n+1\right)$ \[ f\left(\frac{1}{n+1}\right) = f\left(\frac{1}{n}\right) = 0 \]Similarily, if $f\left(\frac{n-1}{n}\right) = 0$, then by $P\left(\frac{-1}{n}, n, n+1\right)$ \[ f\left(\frac{n}{n+1}\right) = f\left(\frac{\frac{-1}{n}+n}{n+1}\right) = f\left(\frac{n-1}{n}\right) \]$\blacksquare$ Claim: $f\left(\frac{m}{n}\right) = 0$ for integers $n \ge 2$ and $m < n - 1$. Proof. Take $P(t, m, n)$ such $2 \le t < n$ and $n \mid mt + 1$ such \[ f\left(\frac{m}{n}\right) = f\left(\frac{mt + 1}{nt}\right) \]which decreases the denominator. Repeating this process gives the result. $\blacksquare$ Thus, $f(x) = 0$ for all $x \in [0, 1)$ and $f(x) = \left\lfloor x\right\rfloor$. Similarily, $f(x) = \left\lceil x \right\rceil$ also works.
03.08.2023 05:55
Suppose there exist integer $x$ such that $f(x)\neq x$. Then, any fraction whose numerators differ by $f(x)-x$ have equal image under $f$. Thus, \[f\left(\frac{a}{b}\right)=f\left(\frac{a+n|f(x)-x|}{b}\right)\]for integer $n$. Let $b=qs|f(x)-x|$, $a=sp|f(x)-x|$, $n=qr-sp$ for integers $p,q,r,s$ and $q,s\ge 1$. Then, $f(\tfrac{p}{q})=f(\tfrac{r}{s})$ so $f$ is constant, which works. Now assume $f$ is nonconstant, and $f(x)=x$ for all integers $x$ $~$ Note that if $f(x)=f(y)$ then $f(\tfrac{x+a}{b})=f(\tfrac{y+a}{b})$. Suppose $f(0.5)\not\in \{0,1\}$ then $2|f(0.5)-0.5|>1$. Let $b=2|f(0.5)-0.5|$, $x=0.5$, $a=0.5b-0.5$ then \[\frac{f(x)+a}{b}=\frac{(f(0.5)-0.5+|f(0.5)-0.5|)}{2|f(0.5)-0.5|}\in\{0,1\}\]However, $\tfrac{x+a}{b}=0.5$ so $f(\tfrac{x+a}{b})\not\in\{0,1\}$, contradiction. The two cases are very similar so WLOG $f(0.5)=0$. Call $r\in \mathbb Q$ good if $f(r)=0$. We claim that all rationals in $[0,1)$ are good. Then, $f(f(x)+a)=f(x+a)$ implies $f(x)=\lfloor x\rfloor$ for all $x$. Similarly, $f(0.5)=1$ will give ceiling. These work, so it suffices to prove our claim. $~$ Call $n$ an angel if for all $r\in \{1,2,\dots,n-1\}$, $\tfrac{r}{n}$ is good. Let $m$ and $n$ be angels. Let $k$ be any integer in $1,2,\dots,mn-1$. Then, let $k\equiv r\pmod m$ and $k=mq+r$ for some $q\in \{0,1,\dots,n-1\}$. Let $a=q$ and $b=n$ then \begin{align*} f\left(\frac{q}{n}\right) &=f\left(\frac{\frac{r}{m}+q}{n}\right) \\ &= f\left(\frac{mq+r}{mn}\right) \\ &= f\left(\frac{k}{mn}\right) \end{align*}so $\tfrac{k}{mn}$ is good. Thus, $mn$ is an angel. $~$ We'll show that all numbers are angels by induction. Suppose all $i\le n-1$ are angels then if $n$ is not a prime, it is a product of angels and therefore is an angel. Suppose $n$ is prime and let $k\in \{1,2,\dots,n-1\}$. Find $p,q$ with $np-qk$ and $q\in\{1,2,\dots,n-1\}$ and $p\in \{1,2,\dots,q\}$. Set $a=k,b=n$ then since $\tfrac{1}{q}$ is good, \begin{align*} f\left(\frac{k}{n}\right) &=f\left(\frac{\frac{1}{q}+k}{n}\right) \\ &= f\left(\frac{kq+1}{qn}\right) \\ &= f\left(\frac{p}{q}\right) \end{align*}so $n$ is an angel. We are done.
30.10.2023 23:06
Cute. Solved while meowing excessively. The answer is all all constant functions $f(x) = c, c \in \mathbb Z$, along with $f(x) = \lfloor x \rfloor$ and $f(x) = \lceil x \rceil$ which can be verified using known identities. Let $n$ be an integer. Suppose that we have that $f(n) - n \neq 0.$ Then, write $f(n) = n + m$ for a nonzero integer $m$. Therefore, \[ f \left( \frac{n + m + a}{b} \right) = f \left( \frac{n + a}{b} \right). \]Since $a$ is any integer, we obtain that \[ f \left( \frac{m + a}{b} \right) = f \left( \frac{a}{b} \right). \]Here $a \in \mathbb Z$ and $b \in \mathbb Z^+$. We can also WLOG assume $m$ is positive; if not, just write the periodicity the other way. By letting $a = ma'$ and $b = mb'$, where $b' > 0$, we obtain \[ f \left( \frac{a'}{b'} + \frac{1}{b'} \right) = f \left( \frac{a'}{b'} \right) \]which means that all $f$ values are equal to $f(0)$. Henceforth assume that $f(n) = n$ for all integers $n$. From $b=1$, we obtain that \[ f(x) + a = f(x + a). \]Thus we just need to compute $f(x)$ on the interval $[0,1)$ to win. Now notice that \[ f\left( 0 \right) = f \left( \frac{\frac 12- f\left( \frac 12 \right)}{b} \right). \]It then follows that by setting $b = \left \lvert 1 - 2f\left( \frac 12 \right) \right \rvert$, we have that either $f \left( \frac{1}{2} \right)$ or $f \left( - \frac 12 \right)$ is $0$. We will solve the problem for $f \left(\frac{1}{2} \right) = 0$, as there exists an analogous process for the other case. Firstly, if $f \left( \frac ab \right) = 0$, \[ f\left( \frac{a}{b + 1} \right) = f \left( \frac{\frac ab + a}{b + 1} \right) = f \left( \frac{a}{b} \right) = 0. \]Therefore, $f \left( \frac{1}{n} \right) = 0$ for $n > 0$. We will use induction here. Suppose that for all integers $1 \le n \le m$, we have that for all integers $k > n$, \[ f \left( \frac{n}{k} \right) = 0. \]We will show that $f \left( \frac{m+1}{m+2} \right) = 0.$ Indeed, \[ f\left( \frac{f \left( \frac 1n \right) + a}{b} \right) = f \left( \frac ab \right) = f \left( \frac{an + 1}{bn} \right). \]Setting $a = m$ and $n = m+2$, $b = m+1$, we find that $f(a/b) = 0$, and \[ \frac{an + 1}{bn} = \frac{(m+1)^2}{(m+2)(m+1)} = \frac{m+1}{m+2} \]as desired. Each step here can be carried out analogously for the case of $f\left( - \frac 12 \right) = 0$, which yields the two functions \[ f(x) = \lfloor x \rfloor \qquad f(x) = \lceil x \rceil. \] I would like to remark that the guessing of the solution set is partially motivated due to the known identity \[ \left \lfloor \frac{\lfloor x \rfloor}{n} \right \rfloor = \left \lfloor \frac{x}{n} \right \rfloor, x \in \mathbb R, n \in \mathbb N. \]
04.11.2023 06:51
wait if c_1 is a constant non integer and f(c_1)=c_2\ne c_1 then f(\frac{c_1+a}b)=\frac{c_2+a}b) so f is periodic no? and since a,b arbitary f is constant? otherwise easy to establish f(n)=n for all int n but the rationals don't seem right
04.11.2023 06:55
signifance wrote: wait if c_1 is a constant and f(c_1)=c_2\ne c_1 then f(\frac{c_1+a}b)=\frac{c_2+a}b) so f is periodic no? and since a,b arbitary f is constnat? this doesn't seem riht Constant does not follow. Even periodicity doesn't really follow tbh.
04.11.2023 06:57
is it not periodic with period (c_2-c_1)/b ? it's 11 rn so my brain might just be out of the window hello cyclicisl perhaps you could provide some insight how does one see that this does not work obviously floor roof constant work i don't know why they don't fit what i said
05.11.2023 00:19
@YaoAops isn't it strange how no one has answered? Anyways here's my complete sol, still not sure why the periodicity doesn't work. BTW, I computed f(n)=n and promptly forgot that f(f(x)+a)=f(x)+a for a very long time (wasted like half an hour) because of domain and range. Also, keep on forgetting domain is not reals bc i do too much fe it's second nature now We claim the answer is the ceiling, floor, and all constant functions. If for some integer n we have $f(n)-n=m\ne0$, by shifting a we have $f(\frac{m+a}b)=f(\frac ab)$; it's easy to check now that f is constant by arbitrary c,d,e,f integers (d,f positive) with $b=dfm$, $a=cfm$, $n=de-cf$, this gives $f(\frac cd)=f(\frac ef)$, and all constant solutions work. Henceforth f(n)=n for all integers n. If $$f(\tfrac12)\not\in\{0,1\}\text{ then }(x,a,b)=(\tfrac12,-\tfrac12,2|f(\tfrac12)-\tfrac12|>1)\Rightarrow f(\tfrac12)=f(0)=0\text{ if }f(\tfrac12)>\tfrac12\text{; otherwise take }a=-f(\tfrac12)\Rightarrow 0=f(0)=f(\frac12),$$contradiction, so our assumption was wrong; WLOG $f(\tfrac12)=0$. We'll show by induction that for integers n we have $f(\frac n{n+1})=0$; base case n=1 is immediate, so assume the inductive hypotheses. Now $$f(\tfrac ab)=0\implies 0=f\left(\tfrac{a+f(\tfrac ab)}b\right)=f\left(\tfrac{a+\tfrac ab}b\right)=f(\tfrac{a+1}b)\Rightarrow f(\tfrac1n)=0\implies f(\tfrac ab)=f(\tfrac{an+1}{bn}),$$which, upon setting a=m,b=m+1,n=m+2, easily simplifies to $0=f(\tfrac m{m+1})=f(\frac{m+1}{m+2})$ (note that we actually had a lot of freedom here: we only needed (an+1)(m+2)=(bn)(m+1),a<b so we could essentially choose a and b). We conclude that the answer is the floor function by increasing n infinitely, since all $f(x)=0\forall 0\le x<1$ and $f(x)+a=f(f(x)+a)=f(x+a)$ (ceiling is analogous when f(1/2)=1).
25.12.2023 19:08
The answer is $f(x)=\lfloor x\rfloor$, $f(x)=\lceil x \rceil$, and $f \equiv c$ for any $c \in \mathbb{Z}$. These clearly work. Suppose that there exists some integer $n$ where $f(n) \neq n$. I claim that $f$ is constant. Indeed, given two rationals we may then write them (in some order) as $\tfrac{p}{r}$ and $\tfrac{q}{r}$ for some $r>0$ such that $n-f(n):=k \mid p-q$ and $q>p$, whence $$f\left(\frac{p}{r}\right)=f\left(\frac{k+p}{r}\right)=\cdots=f\left(\frac{q}{r}\right).$$Thus suppose henceforth that $f(n)=n$ for all integers $n$. Substitute $b=1$ and $a=1$ to get $f(f(x)+1)=f(x+1) \implies f(x+1)=f(x)+1$ since $f(x)+1 \in \mathbb{Z}$. Substitute $a=-f(x)$ to find that $f(\tfrac{x-f(x)}{b})=0$ for all $b \in \mathbb{Z}^+$. Now, $\tfrac{1}{2}-f(\tfrac{1}{2})$ is half of an integer, hence $$f\left(\frac{\frac{1}{2}-f(\frac{1}{2})}{2|\frac{1}{2}-f(\frac{1}{2})|}\right)=f\left(\pm \frac{1}{2}\right)=0.$$ Suppose that $f(\tfrac{1}{2})=0$. I claim that $f$ is identically $0$ on $(0,1)$. This is by induction on the denominator, with the base case of $2$ complete. Suppose that we know all $f(\tfrac{i}{k-1})$ are $0$, where $1 \leq i<k-1$. Then for any such $i$ we have $$f\left(\frac{0+i}{k}\right)=f\left(\frac{\frac{i}{k-1}+i}{k}\right)=f\left(\frac{i}{k-1}\right)=0.$$Now, since $f(\tfrac{1}{2})=0$, we also have $$0=f\left(\frac{0+1}{2}\right)=f\left(\frac{\frac{k-2}{k}+1}{2}\right)=f\left(\frac{k-1}{k}\right),$$since $k-2 \geq 1$, completing the induction. Now, since $f(x+1)=f(x)+1$ we recover $f(x)=\lfloor x\rfloor$ for all $x$. If $f(-\tfrac{1}{2})=0$, we can do essentially the same thing to get $f$ identically $0$ on $(-1,0)$, which means $f(x)=\lceil x\rceil$, finishing the problem. $\blacksquare$ Remark: I originally think I had some induction approach that might have involved first pinning down dyadic rationals in $(0,1)$ but I'm not sure. It might've been isomorphic to this one with the dyadic rational part being unnecessary.
26.07.2024 22:33
31.08.2024 08:27
The answer is $f(x) = \boxed{c, \lfloor x \rfloor, \lceil x \rceil}$, which works. Denote the given assertion as $P(x,a,b)$. If $f$ is constant, it clearly satisfies the conditions, so assume $f$ is nonconstant henceforth. Claim 1: $f(x) = x$ is satisfied for all $x \in \mathbb{Z}$, implying that $f(f(x)) = f(x)$. Proof: Suppose there exists a value $n \in \mathbb{Z}$ such that $f(n) = n+m$ for $m \neq 0$. Plugging in $P(n,am-n,bm)$ gives \[f\left(\frac{a+1}{b} \right) = f\left(\frac{a}{b} \right).\] Hence, $f$ is equal over all rationals, a contradiction. $\square$ Notice that $P(x,a,1)$ gives \[f(x+a) = f(f(x)+a) f(x)+a.\] Claim 2: $f(\tfrac{1}{2}) = \{0,1\}$ Proof: Denote $f(\tfrac{1}{2})$ as $k$ for brevity. If $k<0$, then $P(\tfrac{1}{2}, -k, 1-2k)$ gives \[k = f(0) = 0,\] a contradiction. If $k>1$, then $P(\tfrac{1}{2}, k-1, 2k-1)$ gives \[k = f(1) = 1,\] another contradiction. Hence, $k = 0$ or $k=1$. $\square$ Now, $P(\tfrac{1}{2}, a,b)$ yields \[f\left(\frac{k+a}{b}\right) = f\left(\frac{\frac{1}{2}+a}{b} \right).\] WLOG suppose $k=0$ over the range $[0,1]$ such that we can use symmetry to solve the $k=1$ case. Claim 3: $P(\tfrac{1}{n}) = P(\tfrac{n-1}{n}) = 0$ for $n \ge 2$. Proof: We will induct on $n$. The base case $n=2$ is vacuous. If $P(\tfrac{1}{n}) = 0$, then $P(\tfrac{1}{n}, 1, n+1)$ yields \[f\left(\frac{1}{n+1} \right) = f\left(\frac{1}{n} \right) = 0.\] Similarly, $P(-\tfrac{1}{n}, n, n+1)$ yields \[f\left(\frac{n}{n+1} \right) = f\left(\frac{n-1}{n} \right),\] since $f(-\tfrac{1}{n}) = f(\tfrac{n-1}{n})$. Thus, the induction is complete. $\square$ Now, it suffices to reduce every rational number $x = \tfrac{m}{n}$ into one of the forms described in Claim 3. Suppose that $n \ge 2$, $m<n-1$, and $\gcd(m,n) = 1$. Clearly, $n$ has an inverse modulo $m$, denote it as $n'$. Then, \[\ell = \frac{n(m-n')+1}{m}\] is an integer; setting $P(\tfrac{1}{n}, m-n', \ell)$ yields \[f\left(\frac{m-n'}{\ell} \right) = f\left(\frac{m}{n}\right).\] We can repeat this process as many times as necessary to show that $f(\tfrac{m}{n}) = 0$. Moreover, the process can only be repeated a finite amount of times as $\ell < n$. Hence, for all rational numbers in the range $[0,1)$, we have $f(x)=0$. This shows that $f(x) = \lfloor x \rfloor$. As for the $k=1$ case, we can apply similar logic to find $f(x) = \lceil x \rceil.$ Remarks: To keep the ending step rigorous, we require $a<b<n$. However, this is not hard to prove as we can simply plug in $b = \tfrac{na+1}{m}$ and use the given bounds on $a,b,m,n$.
25.12.2024 02:39
Denote $P(x,a,b)$ the assertion of the given F.E. Claim 1: Iterations of $f$ are just $f$. Proof: $P(x,0,1)$ gives $f(f(x))=f(x)$ which concludes. Claim 2: If $f(n) \ne n$ for all $n \in \mathbb Z$ then $f$ is constant. Proof: Suppose there exists some $n \in \mathbb Z$ with $f(n) \ne n$ then let $m=|f(n)-n|>0$ then notice that $f \left(\frac{a}{b} \right)=f \left(\frac{a+km}{b} \right)$ for $a \in \mathbb Z, b \in \mathbb Z_{>0}$ and $k \in \mathbb Z$. But this can be used to our advantage if you consider $v>u$ integers and then $f \left(\frac{u}{b} \right)=f \left(\frac{um}{bm} \right)=f \left(\frac{vm}{bm} \right)=f \left(\frac{v}{b} \right)$ therefore $f$ is constant everywhere for a good pick of $u,v,b$. Claim 3: It's enough to find values of $f$ in $(0,1)$. Proof: $P(x,a,1)$ gives $f(x+a)=f(f(x)+a)=f(x)+a$ for any $a \in \mathbb Z$ which concludes. Finish: First we focus on $f \left(\frac{1}{2} \right)$, we first say if $f \left(\frac{1}{2} \right) \le 0$ then $P \left(\frac{1}{2}, -f \left(\frac{1}{2} \right), 1-2f \left(\frac{1}{2} \right) \right)$ gives that $f \left(\frac{1}{2} \right) =0$, now inductively say $f \left(\frac{1}{n} \right)=0$ for all $k \ge n$ then $P \left(\frac{1}{k}, 1, k+1 \right)$ gives that $f \left(\frac{1}{k+1} \right)=0$ therefore $f \left(\frac{1}{n} \right)=0$ for all $n \ge 2$ integers, now observe that from $P \left(\frac{1}{n}, 1, b \right)$ for $n \ge 2$ then we get that $f \left(\frac{n+1}{bn} \right)=0$, for example if $n=3$ and $b=2$ we get $f \left(\frac{2}{3} \right)=0$ and we can iterate these more and more, which leads us to prove by induction on $a$ that for all $1 \le a<b$ we have that $f \left(\frac{a}{b} \right)=0$, clearly our basecase if $a=1$, now if it was true for all positive integers of at most $\ell$ we prove it for $\ell+1$, so now we want $f \left(\frac{\ell+1}{b} \right)=0$ for all $b>\ell+1$, clearly if $\ell+1 \mid b$ this is trivial or when $\ell \mid b$ in fact it holds true if $\gcd(\ell+1,b)>1$ so now assume that $\gcd(\ell+1,b)=1$, our pick is gonna be $P \left(\frac{\ell}{b}, \frac{b'(\ell+1)-\ell}{b}, b' \right)$ where $b'$ is large enough is so that $b'(\ell+1) \equiv \ell \pmod b$ which exists because $\ell+1$ has an inverse $\pmod b$ as a result of coprime-ness, and also $b>\ell+1$, clearly in this pick $a<b$ so we are fine to conclude that $f \left(\frac{\ell+1}{b} \right)=0$ therefore the induction is complete, and from here its easy to conclude that $f(x)=\lfloor x \rfloor$ thus done. The other case is basically analogous where you instead prove that $f \left(\frac{-1}{2} \right)=0$ and then do the same process but with the sign swapped and then add $1$ to get in this case that $f(x)= \lceil x \rceil$, since its easy to verify these 3 solutions all work, we are done .