Let $\mathbb N$ be the set of positive integers. Find all functions $f\colon\mathbb N\to\mathbb N$ such that $$\frac{f(x)-f(y)+x+y}{x-y+1}$$is an integer, for all positive integers $x,y$ with $x>y$.
Problem
Source: Israeli Olympic Revenge 2021, Problem 1
Tags: number theory, functional equation, algebra, function
29.08.2021 10:27
$$x-y+1\not= 0$$$$\frac{f(x)-f(y)+x+y}{x-y+1}=k\in \mathbb{Z}$$$$f(x)-f(y)=k(x-y+1)-x-y=(k-1)x-(k+1)y+k$$$$f(n)-f(n-1)=k-2n+1$$$$f(n-1)-f(n-2)=k-2(n-1)+1$$$$f(2)-f(1)=k-2\cdot 2+1$$$$f(n)=(k+1)(n-1)-(n+2)(n-1)$$
29.08.2021 10:30
@above How could you know the integer is always $k$?
29.08.2021 11:38
Israeli Olympic Revenge 2021/1 wrote: Let $\mathbb N$ be the set of positive integers. Find all functions $f\colon\mathbb N\to\mathbb N$ such that $$\frac{f(x)-f(y)+x+y}{x-y+1}$$is an integer, for all positive integers $x,y$ with $x>y$. Interesting. Rewrite this as \[ P(x,y) : x - y + 1 \mid f(x) - f(y) + x + y \]The only such function is $f(x) = x^2 + a$ where $a \ge 0$ is a constant. This indeed works, as \[ f(x) - f(y) + x + y = x^2 - y^2 + x + y = (x + y)(x - y + 1) \] Now, note that if $f$ is a solution, then $f + a$, where $a \ge 0$ is a constant, is also a solution. Therefore, WLOG $f(1) = 1$ by shifting it to $f: \mathbb{N} \to \mathbb{Z}$. It suffices to prove that $f(x) = x^2$ for all $x \in \mathbb{N}$. Claim 01. $x \mid f(x+a) - a^2$ for any $a \ge 0$ and $x \in \mathbb{N}$. Proof. This is obviously true for $x = 1$, so we only care about $x \ge 2$. Take $P(x,1)$ to get $x \mid f(x)$. Now, we'll prove this by induction. Suppose that the statement above is true for all $a < k$, where $k \in \mathbb{N}$, then consider $P(2x + k - 1, x + k)$ for all $x \ge 2$, which gives us \[ x \mid f(2x + k - 1) - f(x + k) + 2k - 1 \]However, $x \mid 2x \mid f(2x + k - 1) - (k - 1)^2$ by induction. Therefore, \[ x \mid (k - 1)^2 + 2k - 1 - f(x + k) \implies x \mid f(x + k) - k^2 \]which proves the inductive hypothesis. To finish the problem, take $P(x + m - 1, m)$ for any $m \in \mathbb{N}$ and we get \[ x \mid f(x + m - 1) - f(m) + 2m - 1 \]However, $x \mid f(x + m - 1) - (m - 1)^2$, which implies \[ x \mid m^2 - f(m) \]for a fixed $m$ and any $x \ge 2$. Take really large $x$ and we conclude that $f(m) = m^2$.
29.08.2021 12:10
@above I suggest keeping $f(1)-1$ in the proof, which is more rigorous because you cannot shift downward to $f(1)=1$ if $f(1)>f(2)$. Anyway, nice solution @2below Yeah, that's another possible way to avoid this issue.
29.08.2021 12:11
Let $p$ be any prime number. Then $P(x+pk-1,x)\implies f(x+pk-1)\equiv f(x)-2x+1$ (mod $p)$ and $P(x+pk,x+1) \implies f(x+pk)\equiv f(x+1)-2x-1$ (mod $p)$. $f(x+pt+pk-1) \equiv f(x+pt)-2(x+pt)+1$ (mod $p)$ $\implies f(x)-2x+1 \equiv f(x+1)-2x-1-2x+1 \implies f(x)+2x+1\equiv f(x+1)$ (mod $p)$. The last one is true for all primes which implies $f(x+1)=f(x)+2x+1 \implies f(x)=2x-1+2x-3+...+3+f(1)=x^2+f(1)-1=x^2+c$ for $c\ge 0$ which fits.
29.08.2021 12:14
mathematics2004 wrote: @above I suggest keeping $f(1)-1$ in the proof, which is more rigorous because you cannot shift downward to $f(1)=1$ if $f(1)>f(2)$. Anyway, nice solution We can generalize the problem to find all such functions $f\colon\mathbb N\to\mathbb Z$ and then we can use any shift.
29.08.2021 12:25
We generalize to find all such functions $f\colon\mathbb N\to\mathbb Z$. Let $g(x)=f(x)-x^2$. Then $$x-y+1\mid f(x)-f(y)+x+y=g(y)-g(y)+x^2-y^2+x+y=g(x)-g(y)+(x+y)(x-y+1)$$ Hence the problem is equivalent to $x-y+1\mid g(x)-g(y)$. Equivalently, $n+1\mid g(x+n)-g(x)$ for all $x,n\in\mathbb N$. Call this $P(x,n)$. Let $x>1$ be an integer. $P(x,n)\implies n+1\mid g(x+n)-g(x)$ $P(x+n,n)\implies n+1\mid g(x+2n)-g(x+n)\implies n+1\mid g(x+2n)-g(x)$ $P(x-1,2n+1)\implies n+1\mid 2n+2\mid g(x+2n)-g(x-1)$ Hence $n+1\mid g(x)-g(x-1)$. Taking a large $n$ we obtain $g(x-1)=g(x)$. Hence $g$ is constant, so $f(x)=x^2+c$ for some integer constant $c$. Back to the original problem. Since the range of $f$ is $\mathbb N$, $f$ works only if $c\ge 0$. Since $g$ works, $f$ works by the equivalence above.
09.10.2021 05:00
Let $f(x)=x^2+g(x)$, so the F.E. becomes: $$x-y+1 \mid x^2-y^2+x+y+g(x)-g(y)=(x+y)(x-y+1)+g(x)-g(y) \implies x-y+1 \mid g(x)-g(y)$$Now let $P(x,y)$ the assertion of the given F.E. and let $a_{\infty}$ be a kinda large positive integer. $P(a_{\infty}+x,x)$ $$a_{\infty}+1 \mid g(a_{\infty}+x)-g(x)$$$P(2a_{\infty}+x,a_{\infty}+x)$ $$a_{\infty}+1 \mid g(2a_{\infty}+x)-g(a_{\infty}+x) \implies a_{\infty}+1 \mid g(2a_{\infty}+x)-g(x)$$$P(2a_{\infty}+x,x-1)$ $$a_{\infty}+1 \mid 2a_{\infty}+2 \mid g(2a_{\infty}+x)-g(x-1) \implies a_{\infty}+1 \mid g(x-1)-g(x) \implies g(x-1)=g(x) \; \forall x>1$$Thus $g$ is constant, and if we let $g(x)=c$, we have that $1+c=f(1) \in \mathbb N$ thus $c \ge 0$ and the solution to this F.E. is $f(x)=x^2+c$ where $c \ge 0$, and we are done