Let $\mathbb N$ be the set of all positive integers. A subset $A$ of $\mathbb N$ is sum-free if, whenever $x$ and $y$ are (not necessarily distinct) members of $A$, their sum $x+y$ does not belong to $A$. Determine all surjective functions $f:\mathbb N\to\mathbb N$ such that, for each sum-free subset $A$ of $\mathbb N$, the image $\{f(a):a\in A\}$ is also sum-free. Note: a function $f:\mathbb N\to\mathbb N$ is surjective if, for every positive integer $n$, there exists a positive integer $m$ such that $f(m)=n$.
Problem
Source: Romanian Masters of Mathematics 2020, Problem 4
Tags: function, algebra, RMM, RMM 2020
01.03.2020 13:45
But isn't it obvious $f$ should satisfy Cauchy equation?
01.03.2020 13:46
dgrozev wrote: But isn't it obvious $f$ should satisfy Cauchy equation? why do you think its obvious?
01.03.2020 13:52
01.03.2020 13:54
Hax.Mode.ON3 wrote: dgrozev wrote: But isn't it obvious $f$ should satisfy Cauchy equation? why do you think its obvious? Because if $f(x)+f(y)=z'$ and $f(z)=z'$ then the only possibility is $z=x+y$ otherwise $f$ would not preseve sum-free-ness. And then $f$ is linear and then must be identity.
01.03.2020 13:55
but $f(|y-x|)=f(x)+f(y)$ and $f(x+y)=|f(y)-f(x)|$ might be possible
01.03.2020 13:57
dgrozev wrote: Hax.Mode.ON3 wrote: dgrozev wrote: But isn't it obvious $f$ should satisfy Cauchy equation? why do you think its obvious? Because if $f(x)+f(y)=z'$ and $f(z)=z'$ then the only possibility is $z=x+y$ otherwise $f$ would not preseve sum-free-ness. And then $f$ is linear and then must be identity. $z$ could be any of these numbers: $\{2x, 2y, \frac{x}{2}, \frac{y}{2}, |x-y|, x+y \}$
01.03.2020 14:02
ok, you're right, but starting from $x=y=1$ it could be unraveled. EDIT: As done here.
01.03.2020 14:05
My problem Here's the solution I originally found. As can be seen in the other posts, this is far from optimal, lengthwise at least.
01.03.2020 14:05
Hopefully this solution is correct... The only function is $f(n)=n$, which clearly satisfies the problem condition. We claim that $2f(a)=f(2a)$. Suppose $f(a)=n$. By surjectivity, there's a $c$ such that $f(c)=2n$, so we know that $\{a,c\}$ is not sum-free, meaning that either $2a=c$ or $2c=a$. If the first case occurs, then we have $f(\frac{c}{2})=2n$. Now consider $d$ where $f(d)=4n$. $\{\frac{c}{2},d\}$ is sum-free, so $d=c$ or $d=\frac{c}{4}$. But $d\neq c$, since $f(c)=2n\neq 4n$. Continuing in this manner gives $a$ infinitely divisible by $2$, a contradiction. So we must have the latter case occur, which proves our claim. Now let $x$ be the positive integer satisfying $f(x)=1$. Our goal now is to prove that $f(nx)=n$ for all positive integers $n$. We proceed by induction. (It's easy to compute $f(x),f(2x),f(3x),f(4x)$, which is what inspires this). Suppose $f(nx)=n$ for all $n\leq k$, with $k>1$.. Consider a constant $c$ such that $f(c)=k+1$. We want to show $c=(k+1)x$. Consider $f(c),f(kx)$, and $f(x)$. Since $\{k+1,k,1\}$ is not sum-free, nor is $\{c,kx,x\}$. This means that $c\in\{(k+1)x,(k-1)x,2kx,2x\}$. Assume the first case does not occur. The second case clearly isn't true because of our inductive hypothesis. If $f(2kx)=k+1$, then $k+1=f(2kx)=2f(kx)=2k$ which gives $k=1$, contradiction. The final case doesn't occur because $f(2x)=2\neq k+1$. So we must have $c=(k+1)x$, which completes the induction. We're almost done! Let $f(1)=m$. Then consider $f(2mx)=2m$. Since $\{m,2m\}$ is not sum-free, nor is $\{1,2mx\}$. The only case where this isn't sumfree is if $1+1=2mx\iff mx=1\iff m=1$ and $x=1$. Then we have $f(x)=f(1)=1$, so $f(n)=n$ for all integers $n$ as desired.
01.03.2020 17:23
Here's a different solution to this beautiful problem, which is aimed at proving that $f$ is additive by any means whatsoever : We first prove the following claim:- CLAIM: $f(2x)=2f(x)$ for all $x \in \mathbb{N}$. Proof of Claim Consider $A=\{x,y\}$ where $y \neq 2x, \frac{x}{2}$. Then $A$ is sum-free. Since $f$ is surjective, so $2f(x)$ is in the image of $f$. But $2f(x) \neq f(y)$ for all such $y$. This means that we must have $2f(x)=f(2x)$ or $2f(x)=f \left(\frac{x}{2} \right)$. The second condition is obviously not possible for odd $x$, so we can directly say $f(2x)=2f(x)$ for all odd $x$. Now we induct for the claim on $x \geq 1$. Since $1$ is odd, and the claim holds for all odd $x$, so the base case is true. Suppose it is true for all $1,2, \dots ,x-1$. FTSOC assume it is untrue for $x$ (obviously $x$ must be even, so let us write $x=2k$). Then the second equality must hold to give $2f(2k)=f(k)$. But, since $k<x$, so by induction hypothesis we have $f(2k)=2f(k)$, a contradiction. Thus, $f(2x)=2f(x)$, competing our induction. $\Box$ Return to the problem at hand. Consider the set $A=\{x,y,z\}$ with $x>y$. For $A$ to be sum-free, we must have $z \neq \frac{x}{2},\frac{y}{2},2x,2y,x-y,x+y$ and $y \neq \frac{x}{2}$ (Since $y<x$, so $y \neq 2x$ automatically holds). Then, in a similar fashion as our proof of Claim, we get that $$f(x)+f(y) \in \{f \left(\frac{x}{2} \right),f \left(\frac{y}{2} \right),f(2x),f(2y),f(x-y),f(x+y)\} \text{ } \forall x>y \geq 1 \text{ and } x \neq 2y$$Suppose $f(x)+f(y)=f(2x)$. By our Claim above, $f(2x)=2f(x)$ and $2f(x) \neq f(a)$ for all $a \neq 2x,\frac{x}{2}$. Since $y$ satisfies these conditions, so $2f(x)=f(y)$ is not possible. In a similar way, we can show that $f(x)+f(y)$ cannot be equal to $f(2y),f \left(\frac{x}{2} \right)$ and $f \left(\frac{x}{2} \right)$. Thus, the only possibility left is $f(x)+f(y)=f(x-y)$ or $f(x)+f(y)=f(x+y)$. Call this assertion $P(x,y)$. Call a pair of integers $(x,y)$ with $x>y \geq 1$ and $x \neq 2y$ a weird pair if $f(x)+f(y)=f(x-y)$. Consider the weird pair $(x_0,y_0)$ such that $x_0+y_0$ is minimum. First consider the case when $x_0>2y_0$ and $x_0 \neq 3y_0$ (The second condition is needed so that $x_0-y_0 \neq 2y_0$). Then $P(x_0-y_0,y_0)$ gives that $f(x_0-y_0)+f(y_0)$ equals either $f(x_0)$ or $f(x_0-2y_0)$. If the second one is true, then $(x_0-y_0,y_0)$ is also a weird pair, which contradicts our minimality assumption. Thus, we must have $f(x_0-y_0)+f(y_0)=f(x_0)$, which along with the fact that $(x_0,y_0)$ is weird gives that $f(y_0)=0$. This is not possible, and so we must have either $x_0<2y_0$ or $x_0=3y_0$. Suppose $x_0<2y_0$ and $x_0 \neq \frac{3y_0}{2}$. Consider $P(y_0,x_0-y_0)$, which gives that $f(y_0)+f(x_0-y_0)=f(x_0)$ or $f(2y_0-x_0)$. In the second situation, $(y_0,x_0-y_0)$ is also a weird pair, which contradicts our minimality assumption.Thus, we must have $f(y_0)+f(x_0-y_0)=f(x_0)$, which along with the fact that $(x_0,y_0)$ is weird gives $f(y_0)=0$. Again, this is not possible, and so we are left with just two possibilities, namely $x_0=3y_0$ and $x_0=\frac{3y_0}{2}$. If $x_0=3y_0$, then we get $f(3y_0)=f(y_0)$ (since $f(3y_0-y_0)=2f(y_0)$ by our Claim). Now, $P(3y_0,2y_0)$ gives $f(3y_0)+2f(y_0)=f(5y_0)$ or $f(y_0)$. The second one is obviously not true, so we have $f(3y_0)+f(2y_0)=f(5y_0)$. But, $P(4y_0,y_0)$ forces $f(5y_0)=f(y_0)+f(4y_0)$, since $f(y_0)+f(4y_0)=f(3y_0)$ is untrue (Remember $f(3y_0)=f(y_0)$). Using $f(4y_0)=2f(2y_0)=4f(y_0)$, we have $$f(3y_0)+2f(y_0)=f(y_0)+f(4y_0)=5f(y_0) \Rightarrow f(3y_0)=3f(y_0) \rightarrow \text{Contradiction!}$$ Finally, if $x_0=\frac{3y_0}{2}$, then $$f \left(\frac{3y_0}{2} \right)+f(y_0)=f \left(\frac{y_0}{2} \right) \Rightarrow f \left(\frac{3y_0}{2} \right)+f \left(\frac{y_0}{2} \right)=0 \rightarrow \text{Contradiction!}$$ Thus, we have arrived at a contradiction in all possible cases, which means that no weird pair exists. Using $P(x,y)$, this is equivalent to saying that $f(x+y)=f(x)+f(y)$ for all $x>y \geq 1$ and $x \neq 2y$. This equation has already been proved to be true for $x=y$ in our Claim. Now we show that it is true for $x=2y$ as well. To do so, it suffices to prove $f(3x)=3f(x)$. Note that $f(4x)+f(x)=f(5x)=f(3x)+f(2x)$ (since $f(x+y)=f(x)+f(y)$ if $x \neq 2y$ and $x>y$). Then using our initial Claim, we get the desired result. So we have that $f$ is an additive function (i.e. it satisfies Cauchy's functional equation). Since $f$ is bounded from below, so this translates to $f(x)=cx$ for every $x \in \mathbb{N}$. But if $c>1$, then $f$ will not be surjective. Thus, the only surjective function which satisfies the given conditions is the identity function, which is trivially a solution. $\blacksquare$ REMARKS: I believe the beauty of this problem lies in the fact that it is so easily fakesolvable. I fakesolved it twice (taking 15 minutes each time to "solve"), and in the end it took me a total of 1 hour to solve this problem . Anyway, I believe the above solution is highly motivated, though handling so many cases gets a little boring after some time .
02.03.2020 06:03
For any positive integer $n$, the set $\{n, 2n\}$ is not sum-free. If we fix a $b$ such that $f(b)=2n$, then every $a$ satisfying $f(a)=n$ must be such that $\{a, b\}$ is not sum-free. In particular, the set of possible $a$ is of the form $\{b/2, 2b\}$ (equivalently, $b \in \{a/2, 2a\}$). With this in mind, we can show that: Lemma: $f(2n)=2f(n)$ for every positive integer $n$. Proof. Induct on $\nu_2(n)$. We'll handle the base case and inductive step together. By the above reasoning, any $a$ satisfying $f(a)=2f(n)$ must satisfy $a \in \{n/2, 2n\}$. If $n$ is odd, then we must have $a=2n$, which handles the base case; if $n$ is even, then by hypothesis, we already have $f(n/2)=f(n)/2$, so the only choice for $a$ is $a=2n$. The induction is complete. $\Box$ We now claim that $f$ is bijective. Indeed, if $f(a)=f(b)$ for some $a \neq b$, then $a$ and $b$ must be the two elements of $\{c/2, 2c\}$ for some $c$. However, the above lemma implies that $f(2c) = 4f(c/2)$, contradiction. Now, suppose $f^{-1}(1)=m$. We induct on the claim that $f^{-1}(k)=km$ for all $k \in \mathbb{N}$. Some care needs to be taken with base cases: first, the claim holds for all $k$ which are powers of $2$, by the lemma. Next, since $\{1, 3, 4\}$ is not sum-free, $\{m, f^{-1}(3), 4m\}$ cannot be sum-free; in other words, $f^{-1}(3) \in \{3m, 5m\}$ (not $2m$ or $8m$ because these values are already taken by $f^{-1}(2), f^{-1}(8)$, and not $m/2$ because the lemma would imply $f(m/2)=1/2$). Similarly, considering $\{1, 4, 5\}$ yields $f^{-1}(5) \in \{3m, 5m\}$. If, for contradiction's sake, we have $f^{-1}(3)=5m$, then bijectivity implies $f^{-1}(5)=3m$, and lemma implies $f^{-1}(6)=2f^{-1}(3)=10m$. Now, considering $\{1, 5, 6\}$ means $\{m, 3m, 10m\}$ is not sum-free, but this a contradiction. So, we must have $f^{-1}(3)=3m$, and we have established the claim for $k=1, 2, 3$. Now, assume the claim holds for $1, 2, \dots, k$ where $k \ge 3$ and we would like to show that $f^{-1}(k+1)=(k+1)m$. Note that $\{1, k, k+1\}$ is not sum-free, so $S=\{m, km, f^{-1}(k+1)\}$ cannot be sum-free. By hypothesis + lemma, the values $2m, (k-1)m,$ and $2km$ are already taken by $f^{-1}(2), f^{-1}(k-1),$ and $f^{-1}(2k)$; also, if $km/2$ is an integer, then by the lemma it is already attained by $f^{-1}(f(km)/2)=f^{-1}(k/2)$. This leaves $(k+1)m$ as the only possible choice for $f^{-1}(k+1)$ to make $S$ not sum-free, which completes the induction. The above claim implies that $f^{-1}$ is identically multiplication by $m$, which is only surjective when $m=1$. Hence $f$ must be the identity, which clearly works.
03.03.2020 02:48
Let $m$ be an odd number, and pick $x$ for which $f(x) = 2f(m)$ (which exists since $f$ is surjective). Then, note that the set $f(\{m, x\})$ is not sum free, which means that ${m, x}$ cannot be sum free either. Therefore, we either have $x = 2m$ or $m = 2x$. Since $m$ is odd, we must have $x = 2m$. Now, consider $x$ for which $f(x) = 4f(m)$. The set $f(\{2m, x\})$ is not sum free, so $\{2m, x\}$ cannot be sum free either. Therefore, we either have $2m = 2x$, or $x = 4m$. If $2m = 2x$, we have $x = m$, or $f(m) = 4f(m)$. This is possible only if $f(m) = 0$, contradiction. Hence, we have $x = 4m$. Continuing similarly, we may find that $x = 2^km$ is the unique value of $x$ for which $f(x) = 2^kf(m)$, for any odd $m$ and $k \geq 1$. Now, we show by induction that $f(2m - 1) = (2m - 1)f(1)$ for all positive integers $m$. The base case $m = 1$ is clear. Suppose the result holds for all $n < m$, for some particular $m > 1$; we will show that the result holds at $m$ as well. Since $f(2^kq) = 2^kf(q)$ for all odd $q$ and positive integers $k$, we in fact have that $f(x) = xf(1)$ for all $x < 2m - 1$. Additionally, note that $f(2m) = 2f(m) = 2mf(1)$, since $m < 2m - 1$. Now, let $x$ be such that $f(x) = (2m - 1)f(1)$, and consider $f(\{1, x, 2m\})$. This set is not sum-free, so $\{1, x, 2m\}$ cannot be sum free either. Thus, we have one of the following cases: $x = 2, 2x = 2m, 4m = x, 1 + x = 2m, x + 2m = 1, 2m + 1 = x$. The first case yields $f(2) = (2m - 1)f(1) = 2f(1)$, which is absurd. The second case yields $f(m) = (2m - 1)f(1) = mf(1)$, absurd. The third case yields $f(4m) = 4f(m) = 4mf(1) = (2m - 1)f(1)$, again absurd. The fourth case yields $x = 1 - 2m < 0$, absurd. Finally, consider the last case. We have $f(2m + 1) = (2m - 1)f(1)$. Now, consider the set $\{2, 2m - 3, 2m + 1\}$. This set is clearly sum free. However, its image under $f$ is $\{2f(1), (2m - 3)f(1), (2m - 1)f(1)\}$, which is not sum free, contradiction. Thus, as all other cases fail, we must have $1 + x = 2m$, or $x = 2m - 1$. This completes our induction. Therefore, as we have $f(x) = xf(1)$ for all odd $x$, we have $f(2^kx) = 2^kf(x) = 2^kxf(1)$ for all $k \geq 1$, implying that in fact $f(x) = xf(1)$ for all $x$. Since $x$ is surjective, we must have $f(1) = 1$ (or else the outputs of $f$ have a nontrivial common divisor, contradicting surjectivity). Thus, the only such function is the identity function, as claimed. $\Box$
04.03.2020 18:45
I commented it on my blog.
11.04.2020 03:27
I think nobody posted this solution. Let $f(a_i)=i$ for $i\in N$. Next fix $a_m$ and notice that the set $(a_m,a_k,a_{m+k})$ is bad (its bad if it is not sum free). Then one of following holds: $1.$ $a_m+a_k=a_{m+k}$ Then notice set $(a_k,a_{m+k},a_{m+2k})$ it is bad so $a_{m+k}+a_{k}=a_{m+2k}$ (because $a_{i}$ are different and $a_{m+k}>a_{k}$) By this we get $a_{s+k}-a_{s}=a_{k}$ for sufficiently large $s$ ($s=m+kt$). $2.$ $a_{m+k}+a_{m}=a_k$ Then by similar analysis we get $a_{m+k}+a_k=a_{m+2k}$ and we are back in case $1$. $3.$ $a_{m+k}+a_k=a_{m}$ then consider $a_{m+ik},a_{m+(i+1)k},a_k$ for $i\in N$; it must hold that $a_{m+(i+1)k}+a_{ik+m}=a_k$ for some $i$ ( if it does not hold then $a_{m+ik}-a_{(i+1)k+m}=a_k$ for all $i$ which is impossible, or we would have $a_{m+ik}+a_k=a_{(i+1)k+m}$ but then we have $a_{(i+1)k+m}=a_{(i-1)k+m}$ ). So we are back in case $2$. Next pick large enough $s$ then $a_{s+k}-a_s=a_k$.From here it follows that $a_{s+tk}-a_s=ta_k$ but other way around $a_{s+tk}-a_s=ka_t$. Now just take $k=1$ and we see $a_d=a_1d$. Its left to show that $f$ is injective but this is trivial ( $f(x)=f(a_1d)=d$, then just take set $(x,a_1d,a_12d)$). So $f$ is bijection and we are done.
17.04.2020 13:32
Let $x_0$ be a number such that $f(x_0)=1$. Then consider numbers $x_i$ such that $f(x_i)=2^i$. Then $\{f(x_i), f(x_{i+1})\}$ aren't free, which implies $x_{i+1}\in \{x_i/2, x_i\cdot 2\}$. In the first case, this then implies $x_{i+2}=x_{i+1}/2$ et cetera, but we cannot divide a number by $2$ arbitrarily many times, which means the second case is true. Therefore, $f(2^{n}x_0)=2^n$. By replacing $1$ in this proof by any other positive integer $k$, we get $f(x)=k \implies f(2x)=2k.$ Suppose $f(x)=f(y)$ for some $x,y$. Then the set $\{x,2y\}$ is sumfree, but the set $\{f(x), f(2y)\}$ isn't. Therefore, $f$ is a bijection. Let $x$ be such that $f(2^nx)=2^n$. Then $x$ is odd because if it were even, we would have $2f(x/2)=f(x) \implies 2 \mid 1$. Let $t$ be such that $f(t)=3$, let $g$ be such that $f(g)=5$. Then $\{x,t,4x\}$ is not sumfree, which implies $t \in \{3x,5x\}$. Similarly, $\{x,4x,g\}$ is not sumfree, so $g \in \{3x,5x\}.$ Case 1: $f(3x)=3$ and $f(5x)=5$. Then $f(kx)=k$ for all $k<6$. Suppose for some $n>5$, we have $f(kx)=k$ for all $k<n$. Then let $s$ be such that $f(s)=n$. Then $\{x,(n-1)x,s\}$ is not sumfree, and this implies $s \in \{(n-2)x, nx\}$. The first case is impossible since $f((n-2)x)=n-2$ and therefore, $s=nx$. This completes the induction step, and implies $f(nx)=n$ for all $n$. It is easy to see that $x$ is equal to $1$, otherwise $f(1)=f(xf(1))$, which contradicts injectivity. Case 2: $f(3x)=5$ and $f(5x)=3$. Then $f(6x)=10$. Let $t$ be a number such that $f(t)=7$. Then $\{5x, t, 6x\}$ is not sumfree, and then $t \in \{3x, x, 10x, 11x, 12x\}$. However, $f(3x)=5$, $f(x)=1$, $f(10x)=6$, $f(12x)=20$, which implies $t=11x$, and $f(11x)=7$. This implies that $\{4x,5x, 11x\}$ is not sumfree, which is impossible. Therefore, there are no solutions in this case.
07.06.2020 02:37
Solved with Th3Numb3rThr33. The only solution is the obvious one --- \(f(n)\equiv n\). Claim: \(f(2a)=2f(a)\). Proof. By surjectivity there is an infinite sequence \(a_0\), \(a_1\), \(\ldots\) such that \(f(a_i)=2^if(a)\) for each \(i\). Evidently the elements of \((a_i)\) are all distinct. Observe that \(\{f(a_i),f(a_{i+1})\}\) is never sum-free, so \(\{a_i,a_{i+1}\}\) is not sum-free and \(a_{i+1}\in\{2a_i,a_i/2\}\) for each \(i\). Since the sequence is injective, either \(a_{i+1}=2a_i\) for all \(i\) or \(a_{i+1}=a_i/2\) for all \(i\); the latter is impossible. \(\blacksquare\) Claim: \(f\) is bijective. Proof. Say \(f(a)=f(b)\) but \(a\ne b\). Then \(\{a,2b\}\) is sum-free, but \(\{f(a),f(2b)\}\) is not sum-free. \(\blacksquare\) Let \(g=f^{-1}\), so \(g\) is also bijective, \(g(2a)=2g(a)\) for all \(a\), and \(g\) maps not sum-free sets to not sum-free sets. Let \(g(1)=c\), so \(g(2^i)=2^ic\). By \(\{1,3,4\}\), \(\{1,4,5\}\), we deduce \(\{g(3),g(5)\}=\{3c,5c\}\), and by \(\{1,5,6\}\), we deduce \(g(3)=3c\), \(g(5)=5c\). Now we prove by induction on \(n\) that \(g(n)\equiv cn\). The base cases \(n=1,\ldots,6\) have already been shown. For the inductive step, say \(f(k)=k\) for all \(k<n\). By \(\{1,n-1,n\}\), we have \(f(n)\in\{nc,(n-2)c\}\), but the latter case is impossible since \(f(n-2)=(n-2)c\) already. Finally \(c=1\) since \(g\) is bijective, so we are done.
22.09.2021 19:00
Lemma 1 and Lemma 2 are basically the whole problem, the rest are mere details. Let $f^{-1}(x)$ denote some element of the preimage of $x$, which is given to be non-empty. $\textbf{Lemma 1:}$ $f(2a)=2f(a)$ for all $a \in \mathbb{N}$ $\textbf{Proof)}$ Notice that by taking $\{k,f^{-1}(2f(k))\}$ for some odd $k$, we must have that $$2f(k)=f(2k)$$, as the aforementioned set must not be sum-free. Now, look at $\{a,f^{-1}(2f(a))\}$ and assume FTSOC that $2f(a)=f(\frac{a}{2})$ from which, we get that if $a = 2^nk$ with $k$ odd, then $$2^sf(a) = f(\frac{a}{2^s})$$for all $s \leq v_2(a)$, taking $s = v_2(a)-1$, we have that $$2^{v_2(a)-1}f(a) = f(\frac{a}{2^{v_2(a)-1}}) = 2 \cdot f(\frac{a}{2^{v_2(a)}}) = 2^{v_2(a)+1}f(a)$$using the fact that $f(2k) = 2f(k)$ for odd $k$ which is a contradiction. $\square$ $\textbf{Lemma 2:}$ $f$ is injective $\textbf{Proof)}$ Take $A$ to be the set of odd integers and notice that the image must contain all odd integers as $2 \mid f(2k)$ for all $k \in \mathbb{N}$, we can't have that any even is in the image because then said even can be written as the sum of two elements in the image. Now, assume that $f(a) = f(b)$ after noticing that $v_2(f(a)) = v_2(a)$ meaning that $v_2(a) = v_2(b)$, from which we can assume that $a,b$ are odd as $f(2a) = 2f(a)$. Then, taking $\{a,2b\}$, we have that $a=b$, as desired. $\square$ Now, assume that $f(t)=1$ and take $\{t,3t,f^{-1}(1+f(3t))\}$ which must not be sum-free, then, we have that $f^{-1}(1+f(3t)) \in \{2t,4t,6t\}$, which using $\textbf{Lemma 1}$ and $\textbf{Lemma 2}$ gives us that either $$2 = 2f(t) = f(2t) = 1+f(3t)$$or $$2f(3t) = f(6t) = 1+f(3t)$$which are not possible meaning that $$4=4f(t) = f(4t) = 1+f(3t)$$Consequently, taking $\{kt,kt+t,f^{-1}(f(kt)+f(kt+t))\}$, we have that $$f((2k+1)t)=f(kt)+f((k+1)t)$$for all $k > 2$ which gives us that $f(kt) = k$ for all $k \in \mathbb{N}$ by induction, which means that $f(x) = x$ for all $x \in \mathbb{N}$ as $f$ is bijective. $\blacksquare$
02.10.2021 10:36
Ankoganit wrote: Let $\mathbb N$ be the set of all positive integers. A subset $A$ of $\mathbb N$ is sum-free if, whenever $x$ and $y$ are (not necessarily distinct) members of $A$, their sum $x+y$ does not belong to $A$. Determine all surjective functions $f:\mathbb N\to\mathbb N$ such that, for each sum-free subset $A$ of $\mathbb N$, the image $\{f(a):a\in A\}$ is also sum-free. Note: a function $f:\mathbb N\to\mathbb N$ is surjective if, for every positive integer $n$, there exists a positive integer $m$ such that $f(m)=n$. CLAIM I: $f(2a)=f(a)$ if $a$ is a natural no, there will be a b such that $f(b)=2f(a)$ which gives $b$ must be $2a$ or $\frac{a}{2}$. Proceed by induction that $f(2a)=2f(a)$.Base cases are easy. Suppose we have shown it for upto $n=a-1$.Now , if $f(b)=2f(a)$ ,then if $b=2a$ , we are done.Assume not.Then $b=\frac{a}{2}$ , but then by induction hypothesis , $f(a)=2f(\frac{a}{2})$ which gives a contradiction.Hence $b=2a$ , as desired CLAIM II:$f$ is injective Set $f(a)=f(b)$ with $a \not =b$ .Then $\{b,2a\}$ is sum-free , and so is $\{f(b)=f(a),f(2a)=2f(a)\}$ .Contradiction. CLAIM III:There exists a constant $c \in \mathbb{N}$ such that $f(a)=ac$ for all natural numbers $a$ Take two natural numbers $a$ and $b$ such that $b>a$ .We know then there will exist a $k$ such that $f(k)=f(a)+f(b)$ . If $k \not= (a+b),(b-a) $ take the sum -free set $\{a,b,k\}$ .Then the set $\{f(a),f(b),f(k)=f(a)+f(b)\}$ should be sum-free .Contradiction .So $k \in \{a+b , b-a\}$ . WE know that $f(2a)=2f(a)$ .We will prove that $f(na)=nf(a) $ by induction on $n$ .The base cases $n=1$ and $n=2$ are ready.Suppose the hypothesis is true for $\{n=1,2, \cdots m\}$ . Then $\exists k$ such that $f(k)=(m+1)f(a)$ .Take the set $\{ma, a , k\}$ .We see that it cannot be sum-free .Then $k \in \{(m-1)a ,(m+1)a\}$ .But we know that $f$ is one-one and $f(m-1)a=(m-1)a$ .So $k=(m+1)a$. Induction complete. So we have $\forall a ,b \in \mathbb{N}$ that $$f(ab)=af(b)=bf(a) \implies \frac{f(a)}{f(b)} = \frac{a}{b}$$Take a fixed pair $(a,b)$ Then there is a natural number $n$ such that $f(a)=na$ and $f(b)=nb$ .Take another natural number $c$ .$c$ varies on the set $\mathbb{N}/\{a,b\}$ .Then $$\frac{f(a)}{f(c)} = \frac{a}{c}=\frac{na}{f(c)} \implies f(c) =nc$$It is easy to see that $f(1)=n$ But since $f$ is surjective , it must take the value $1$ at some point. Then $f(k)=1 \implies kf(1)=1 \implies k=f(1)=1$ Thus we have our solution $$\boxed{f(n) =n} \forall n \in \mathbb{N}$$
09.11.2021 09:31
Does this work ? Claim : $f(2x)=2f(x)\hspace{.1 cm} \forall \hspace{.01 cm} x$ Consider $y$ such that $f(y)=2f(x)$ for any $x$. Consider the set $x,x,y$. This is not sum-free, since $f(x),f(x),f(y)$ is not sum free, and consequently, $y=2x$, as desired. Claim : $f$ is injective Assume that $f(x)=f(y)$ for some $x \neq y$. Consider the set $x,x,2y$. This is sum free by assumption ; therefore $f(x),f(x),f(2y)$ is sum free too, a contradiciton by the previous claim. Claim : $f(kx)=kf(x) \hspace{.1 cm} \forall \hspace{.01 cm} k \in \mathbb{N}$ Consider $y$ such that $f(y)=3f(x)$. Now consider $x,2x,y$. If this were sumfree, we would have had $f(x),2f(x),3f(x)$ is sum free, contradiciton. Therefore either $y=3x$ or $y=x$ but the latter is impossible, so $f(3x)=3f(x)$. Now we strong induct, base cases being clear. Say $f(kx)=kf(x) \hspace{.1cm}\forall \hspace{.01 cm} k \in \{1,2, \dots, t\}$. Let $y$ be chosen such that $f(y)=(k+1)x$. If $x,kx,y$ were sum free, we would have that $f(x),kf(x),(k+1)f(x)$ is sum free, contradiction. So we must have $y=(k-1)x$ or $(k+1)x$, but the former fails, so $y=(k+1)x$, completing the induction. Now we have that $f(k)=kf(1) \geq k$ for all $k$, which means that $f(1)=1$ (since none of the others can be $1$) and consequently, $f(k)=k$ for all naturals $k$
20.01.2022 23:15
Answer: The only such function is the identity, i.e $f(n)=n$ for all $n\in \mathbb{N}$ Solution The contrapositive of the condition (for $\vert A \vert =3$, which is what we will focus on) can be written as follows Supose $f(x)=f(a)+f(b)$. Then either $x=a+b$ or $x=\vert a-b\vert$ Now we may define $g: \mathbb{N}\mapsto \mathbb{N}$ by $g(n)=\inf(\{a: f(a)=n, a\in \mathbb{N}\})$ which is well defined due to the surjectivity of $f$. First I contend Claim 1: There exists a constant $c\in \mathbb{N}$ such that $f(nc)=n$ for all $n\in \mathbb{N}$. Proof: Set $c=g(1)$. We will prove by induction that this choice works. First notice that from $2=f(g(2))=f(c)+(c)$, either $g(2)=2c$ or $g(2)=0$. The latter obviously doesn't work, so $g(2)=2c\implies f(2c)=2$. This will serve as our base case. Now notice that $$n+1=f(g(n+1))=f(cn)+f(c)\implies g(n+1)=cn+c=c(n+1) \text{ or } g(n+1)=\vert cn-c\vert=c(n-1)$$but if $g(n+1)=c(n-1)$, then $n+1=f(g(n+1))=f(c(n-1))=n-1$ by induction hypothesis, a contradiction. So $g(n+1)=c(n+1)\implies n+1=f(g(n+1)=f(c(n+1))$, done. $\blacksquare$ We now finish the proof showing the following. Claim 2: $c=1$ Proof: Supose $c>1$ and consider $f(c-1)>1$ due to the minimality of $c$. For every $1\leq x\leq f(c-1)-1$ it holds that $$f(c-1)=x+(f(c-1)-x)=f(cx)+f(c(f(c-1)-x))$$so either $c-1=cx+c(f(c-1)-x)=cf(c-1)$ or $c-1=\vert 2cx-cf(c-1)\vert$. Both cases lead to an immediate contradiction. $\blacksquare$ This proves that $f$ must be the identity, which indeed works.
27.07.2022 18:30
Claim $: f$ is injective. Proof $:$ Assume not so there exists $a,b$ such that $f(a) = f(b)$ and $a \neq b$ then $a,2b$ are sum-free so $f(a) = f(b),f(2b)$ are sum-free so $f(2b) \neq 2f(b)$ so there exists $t$ such that $f(t) = 2f(b)$ so $t,b$ are not sum-free but since $t \neq 2b$ so $t,b$ are sum-free so contradiction which means $f(2b) = 2f(b)$ so $a,b$ don't exist and $f$ is injective. By induction assume for $1\le m \le n : f(mk) = mf(k)$. we will prove $f(k(n+1)) = f(k)(n+1)$. $nk,k$ are sum-free and there exists $t$ such that $f(t) = f(nk) + f(k) = f(k)(n+1)$. By using same approach we used proving $f(2b) = 2f(b)$ we have that $nk,k,t$ cannot be sum-free so either $t = (n+1)k$ or $(n-1)k$ but if $t = (n-1)k$ then by our induction we have $f((n-1)k) = (n-1)f(k)$ so $(n-1)f(k) = (n+1)f(k)$ which gives contradiction so $t = (n+1)k$. we have $f(ab) = af(b)$ so $f(a) = af(1)$. Note that as $f$ is surjective so there exists $c$ such that $f(c) = 1$ so $f(c) = cf(1) \implies 1 = cf(1) \implies f(1) = c = 1$ so $f(a) = af(1) = a$.
28.07.2022 18:55
Nice one
18.08.2022 10:53
The only solution is $\boxed{f(n) = n}$, which works. Claim: For any positive integer $a$, we have $f(2a) = 2f(a)$. Proof: Let $f(k) = 2f(a)$. If $k\ne 2a$, then $a,k$ is sum-free, so $f(a), 2f(a)$ is also sum-free, which is not true. $\square$ Claim: $f$ is injective. Proof: Suppose $f(a) = f(b)$ and $a\ne b$. Notice that $\{f(2a) , f(b)\} $ is not sum-free since $2f(b) = 2f(a) = f(2a)$. So $2a,b$ is also not sum-free, so $b=4a$. In this case, $f(b) = 4f(a)\ne f(a)$, contradiction. $\square$ So $f$ is bijective. Let $x=f^{-1}(1)$. We have $f^{-1}(2) = 2x$, which implies $f^{-1}(4) = 4x$. Claim: $f^{-1}(3) = 3x$. Proof: $1,3,4$ is not sum-free, so $x, f^{-1}(3), 4x$ must also be not sum-free. This implies $f^{-1}(3) \in \{3x,5x\}$. Suppose FTSOC that $f(5x) = 3$. Since $1,4,5$ isn't sum-free, $x, 4x, f^{-1}(5)$ is also not sum-free. So $f^{-1}(5) = 3x$. Now, $2,5,7$ isn't sum-free, so $2x, 3x, f^{-1}(7)$ is also not sum-free. So $f^{-1}(7)\in \{x, 4x, 5x, 6x\}$, not possible as $f(x) = 1, f(4x) = 4, f(5x) = 3, f(6x) = 10$. $\square$ Claim: $f^{-1}(k) = kx$ for all positive integers $k$. Proof: We prove the result by inudction (base cases $1,2,3$). Suppose $f^{-1}(k)= kx$ for all $k<m$, where $m>3$. If $m$ is even, then we have $f(mx) = 2f\left(\frac{m}{2}x \right) = m$, so we can assume $m$ is odd. $1,m-1, m$ isn't sum-free, so $x,(m-1)x, f^{-1}(m) $ isn't sum-free. Since $2x\ne (m-1)x$, we have \[f^{-1}(m)\in \{2x, x\cdot (m-1)/2 , (2m-2)x, (m-2)x, mx\}\] Now, \[f(2x) = 2, f\left(x\cdot \frac{m-1}{2}\right) = \frac{m-1}{2}, f((2m-2)x) = 2f(m-1)x = (2m-2)x, f((m-2)x) = m-2,\]all of which are not equal to $m$. So we must have $f^{-1}(m) = mx$, which completes the induction. $\square$ So $f(kx) = k$ for all positive integers $k$. Let $f(1) = c$. We have $f(1) = f(cx)$, so $cx=1$, which implies $x=1$. So $f(n) = n\forall n$, as desired.
24.08.2022 08:41
Ok so apparently my solution is phrased in terms of inverses (basically finding the input(s) that can result in an output), but I think at its core its similar to most other solutions on this thread due to bijectivity. The only solution is the identity, which clearly works. Let $A_N = \{a_{N, 1} , \cdots a_{N, N_i}\}$ denote the set of natural numbers that output $N$ through $f$. By surjectivity each $A_N$ is nonempty, and every natural number is in exactly one $A_N$. Claim: $f$ is bijective; $f^{-1}(2k) = 2f^{-1}(k) \forall k \in \mathbb{N}$. Proof: Consider the sets $A_k$ and $A_{2k}$ for some $k$. Suppose FTSOC that $A_k$ has at least two elements: $a_{k, 1}, a_{k, 2}$. Meanwhile, consider some $a_{2k, 1}$. Since $\{k, 2k\}$ is not sum-free, by the contrapositive of the problem statement, both $\{a_{k,1}, a_{2k, 1}\}$ and $\{a_{k,2}, a_{2k, 1}\}$ are not sum-free. Some easy casework yields that $a_{k, 1}, a_{k, 2}$ are $x, 4x$ in some order for a $x \in \mathbb{N}$, and $a_{2k,1}= 2x$. Now, consider $a_{4k, 1} \in A_{4k}$. As $\{2k, 4k\}$ is not sum-free, $\{a_{2k, 1}, a_{4k, 1}\}$ are not sum-free, but this means that $a_{4k, 1}$ is either $x$ or $4x$ which is a contradiction as both $x$ and $4x$ are already in $A_k$, and the same number cannot be in two sets (a number can only have one output regarding $f$). Therefore, $f$ is injective and thus bijective. Now, back-tracking, we consider when $a_{k, 1} = x$. If $a_{2k, 1}$ is either $2x$ or $\frac{x}{2}$ by the sum-free condition. If the latter was the case, then by the same argument $a_{4k, 1}$ is either $x$ or $\frac{x}{4}$. The first cannot be true as $x$ is already in $A_k$, so $a_{4k, 1} = \frac{x}{4}$. Iterating this process arbitrarily many times, we will have that for some $a_{2^Mk, 1} = \frac{x}{2^M}$, the fraction will not be an integer; contradiction. Therefore, $2a_{k, 1} = a_{2k, 1}$, or in other words $f^{-1}(2k) = 2f^{-1}(k).$, which is convenient as $f$ is a bijection. $\fbox{}$ Claim: $f^{-1}$ is the identity. Proof: Suppose $f^{-1}(1) = p$. Then $f^{-1}(2) = 2p, f^{-1}(4) = 4p$. Since $\{1, 3, 4\}$ and $\{1, 4, 5\}$ are not sum-free, $\{f^{-1}(1), f^{-1}(3), f^{-1}(4)\}$ and $\{f^{-1}(1), f^{-1}(4), f^{-1}(5)\}$ are not sum-free, from which yields $f^{-1}(3)$ and $f^{-1}(5)$ are $3p$ and $5p$ in some order (they cannot be the same). Assume FTSOC that $f^{-1}(3) = 5p$ and $f^{-1}(5) = 3p$. Then $f^{-1}(6) = 2f^{-1}(3) = 10p$. Since $\{1, 5, 6\}$ is not sum-free, $\{f^{-1}(1), f^{-1}(5), f^{-1}(6)\}= \{p, 3p, 10p\}$ must also not be sum-free, which is a contradiction. So $f^{-1}(3) = 3p$, $f^{-1}(5) = 5p$. Now, we induct. Suppose for $k \ge 5$, $f^{-1}(i)=ip \forall 1 \le i \le k$. Since $\{1, k, k+1\}$ is not sum-free, $\{f^{-1}(1),f^{-1}(k),f^{-1}(k+1)\} = \{p, kp, f^{-1}(k+1)\}$is not as well. Since $f^{-1}(k+1)$ must be a multiple of $p$, and cannot be less than or equal to $kp$—or else it will be equal to some previous $f^{-1}(i)$ which is absurd—, and can also not be $2kp$ as that is the value of $f^{-1}{2k}$, we have that the only possible case is if $f^{-1}(k+1)=(k+1)p$. Thus, $f^{-1}(k) = kp$ for all natural $k$. Now, if $p$ is not $1$, then we have that $1$ is not in the range of $f^{-1}$, which means that it is not in the domain of $f$, which is clearly false. So $p=1$. Therefore, $f^{-1}$ is the identity. $\fbox{}$ This means $f$ is the identity. We are done.
14.04.2023 06:01
We use the contrapositive: if a set is not sum-free, then the pre-image is not. By considering the preimage set of $\{k, 2k\}$, we get that each pre-image has one element and thus $f$ is bijective. Then, for any $a \in \mathbb{N}$ and $s = f^{-1}(f(a) + f(1))$, $\{1, a, s\}$ is not sum-free so $s \in \{a - 1, a + 1\}$. $f$ is bijective. By considering the process of \[ a \to f^{-1}(f(a) + f(1)) \to f^{-1}(f(a) + 2f(1)) \to \dots \] since $\mathbb{N}$ is bounded below by zero, and each $n$ can only appear once in the sequence, the process can not decrease or else it will hit itself and thus \[ f(a+1) = f(a) + f(1) \] As such, that the solution set is $f(x) = x$
14.07.2023 04:09
26.11.2023 05:23
We will use the equivalent assertion that if the image $f(A)$ is not sum-free, then $A$ is not sum-free. Claim: $f(2a) = 2f(a)$. Consider the $u$ such that $f(u) = 2f(a)$. Clearly then $f(a), f(u)$ is not sum-free, so $a,u$ is not sum-free. Either $u = 2a$ or $u = a/2$. If $u = a/2$, then repeat the process for $f(u_1) = 2f(a/2)$ and $a/2, u_1$. We will eventually find that some $u_k$ is a fraction, contradiction. $\square$ Now, assume that $f(1) = c$ for some constant $c$. Claim: $f(x) = cx$. We proceed with induction, base cases $n=1$ and $n=2$ obvious. Then, consider $f(1) = c$, $f(n) = nc$, and $f(u) = (n+1)c$ for some $u$. We must have that $\{ 1, n, u \}$ is not sum-free. But then $u = n-1$ or $u = n+1$, and since we already know $f(n-1) = (n-1)c$, then $f(n+1) = (n+1)c$. $\square$ Since $f$ is surjective, then $c = 1$, implying $f(x) = x$, which works. $\blacksquare$
20.01.2024 08:21
The only solution is the identity function, which clearly works. Claim: For every odd positive integer $m$, $f(m)$ is odd, and $f(2^k\cdot m) = 2^k\cdot f(m)$ for every nonnegative integer $k$. Proof: Since $f$ is surjective, there exists $x$ such that $f(x) = 2f(m)$. By the contrapositive of the problem statement, the set $\{m,x\}$ is not sum-free, so $x=2m$. If $f(m)$ is even, the same reasoning implies $f(2m) = \frac{1}{2}f(m)$, absurd since $f(2m)=2f(m)$. This proves the first part of the claim. For the second part, we induct on $k$ with the base cases of $k=0$ and $k=1$ already having been shown. For $k\ge 2$, pick $x$ such that $f(x)=2^k\cdot f(m)$. Then the set $\{2^{k-1}\cdot m,x\}$ is not sum-free, so $x=2^{k-2}\cdot m$ or $x=2^k\cdot m$. But $f(2^{k-2}\cdot m)=2^{k-2}\cdot f(m)$, so $x=2^k\cdot m$, as desired. We now claim that $f(m) = m\cdot f(1)$ for every odd positive integer $m$, which finishes the problem since then $f(x)\equiv f(1)x$ and the only such surjective function is the identity. We proceed by induction on $m$, with the base case of $m=1$ being shown. Suppose $m\ge 3$, and pick $x$ such that $f(x) = m\cdot f(1)$. By the inductive hypothesis, $f(m-1) = (m-1)f(1)$ and $f(m+1)=(m+1)f(1)$, so the sets $\{1,m-1,x\}$ and $\{1,m+1,x\}$ are both not sum-free, implying $x\in\left\{2,\frac{m-1}{2},2m-2,m-2,m\right\}\cap \left\{2,\frac{m+1}{2},2m+2,m,m+2\right\}$. For $m\ge 3$, the only number in both sets that is at least $m$ is $m$ itself, so $x=m$, as desired.
25.02.2024 05:39
We focus on non-sum-free sets using the contrapositive statement on small cases: 2-element subsets: Construct the sequence $\{a_n: f(a_n) = 2^n \cdot t\}$, which exists by surjectivity. Then $\{f(a_n), f(a_{n+1})\}$ is non-sum-free, so $\{a_n, a_{n+1}\}$ is non-sum-free. It follows that we must have $a_{n+1} = 2a_n$ for all natural $n$; otherwise, the $a_i$'s will overlap, which cannot happen. 3-element subsets: Call a set $\emph{good}$ if the set is non-sum-free but all of its subsets are sum-free. Then the pre-image of a good set is also good. Define $f(1)=k$. We aim to show $f(n)=nk$ through induction. We first note $f(2^m) = 2^m \cdot k$ through 2-element subsets. Then: Suppose the pre-images of $3k$, $5k$ are $p$, $q$, respectively. Noting the good sets \[\{k,3k,4k\}, \{k,4k,5k\}, \{k,5k,6k\} \implies \{1,4,p\}, \{1,4,q\}, \{1,q,2p\} \implies (p,q) = (3,5).\] Assume $f(m)=mk$ for all $m \leq n$, where $n \ge 5$. Suppose the pre-image of $k(n+1)$ is $t$. We now use the good sets \[\{k,k(n-1),kn\}, \{k,kn,k(n+1)\} \implies \{1,n-1,n\}, \{1,n-1,t\} \implies t=n+1.\] Thus $f$ is linear, so surjectivity gives us our only solution of $\boxed{f(x)=x}$, which clearly works. $\blacksquare$
04.09.2024 05:41
Let $f^{-1} (x)$ denote an integer $y$ for which $f(y) = x$. Observe that $f^{-1} (a) \neq f^{-1} (b)$ if $a \neq b$. We show that $f(x) = f(1)x$ with strong induction on $x$: Base case: We deal with $x = 2, 3$ by hand. For $x=2$, let $a = f(1)$. The image of $\{ f^{-1} (a), f^{-1} (2a)\}$ is $\{a , 2a\}$, which is not sum-free. It follows that $f^{-1} (a) = 2f^{-1} (2a)$ or $2f^{-1} (a) = f^{-1} (2a)$. However, the former case is impossible: repeating that same logic combined with the injectivity of $f^{-1}$ creates the impossible infinite chain \[f^{-1} (a) = 2f^{-1} (2a) = 4f^{-1} (4a) = \cdots.\]So, $2 = f^{-1} (a) = f^{-1} (2a)$, or in other words, $f(2) = 2f(1)$. For $x=3$, note that similar reasoning as before shows that $f(4) = 2f(2) = 4f(1)$. The image of $\{ 1, 3, f^{-1} (f(1)+f(3))\}$ is evidently not sum-free, so it follows that \[1 + 3 = f^{-1} ( f(1) + f(3)) \implies f(4) = f(1) + f(3) \implies f(3) = 3f(1).\]In particular, we cannot have $f^{-1} ( f(1) + f(3)) = 2$ since that implies $f(1) = f(3)$, so the image of $\{1, 6 \}$ is $\{ f(1), 2f(1) \}$, contradiction. Inductive step: For $x \geq 4$, consider plugging the set $S = \{1, x-1, f^{-1} (f(1)x) \}$ into $f$. By our inductive hypothesis, the image of this set is not sum-free, so $S$ is not sum-free either. By our inductive hypothesis again, $f^{-1} (xf(1)) \geq x$, so it follows that \[1+(x-1) = f^{-1} (x f(1)) \implies f(x) = xf(1),\]as desired. Since $f$ is surjective, it follows that $f(x) = x$ is the only solution.
30.09.2024 13:56
Suppose $f(g(x))=x$, such a function $g$ clearly exists, we also must have the property that $kg(a)=g(ka)$, thus this implies $g$ is linear as we have for all primes $p$ and $q$ that $p(g(q))=q(g(p))$ and thus $\frac{p}{q}=\frac{g(p)}{g(q)}$. Thus we get for some $c$ $f(cx)=x$, now suppose that $c\neq 1$, let $k$ be a value such that $c\nmid k$, and suppose $f(k)=l$, we have that $f(cl)=l$ and that $f(2cl)=2l$ clearly $\{k, cl, 2cl\}$ is sum free however $\{l, l, 2l\}$ is not sum free which is a contradiction and thus $c=1$ and $f(x)=x$ for all $x$.
21.11.2024 06:57
The answer is $f(x)\equiv x$ only. It clearly works. First I show that $f$ is injective. Suppose $f(a)=f(b)$. Choose large $c,d$ such that $f(d)-f(c)=f(a)=f(b)$ and $d,c >> a,b$ and $f(d),f(c) >> f(a)=f(b)$, which is possible since $f$ is surjective. Then $\{a,c,d\}$ and $\{b,c,d\}$ are both not sum-free, which means $a=b=|c-d|$. Let $a := f^{-1}(1)$, and $x_n := f^{-1}(n)$. Choose $n$ large so that $x_n,n \gg a$. Note that $\{x_n,x_{n+1},\cdots\}$ contain sufficiently large integers (say all integers $\ge a^a, f^{-1}(a^a)$. Then for all $m>n$, $x_{m+1}-x_m \in \pm a$. This implies that $a = \pm 1$ since otherwise $ \{x_n,x_{n+1},\cdots\} \subset x_n + a\mathbb{Z}$, contradiction. If $a=-1$, then since $f$ is bijective, $x_{m+k}-x_{m+k-1} = -1$ for all $k\ge 0$, which is clearly impossible. Hence $f(1) = 1$ and there exists $k,N$ such that for all $n>N$ we have $f(n) = n+k$. It's not hard to check that $k=0$ by choosing $\{n+k,n+k,(2n+k)+k\}$ as our non sum-free set. Fix $b$. Choose large $n >> b,f^{-1}(b)$, and note that $\{b,n+b,n\}$ is not sum-free, so $f^{-1}(b)=b$. Hence $f(x)\equiv x$.