Let $\mathbb{N}$ denote the set of positive integers. Find all functions $f \colon \mathbb{N} \to \mathbb{Z}$ such that \[\left\lfloor \frac{f(mn)}{n} \right\rfloor=f(m)\]for all positive integers $m,n$. Merlijn Staps
Problem
Source: USA TSTST 2022/8
Tags: USA TSTST, functional equation
27.06.2022 19:10
The solution set is trivial to find! This is a standard $\mathbb{N} \rightarrow \mathbb{Z}$ functional equation with a surprise. In my opinion, it has some positive qualities not present in usual $\mathbb{N} \rightarrow \mathbb{Z}$ functional equations. The statement is clean and memorable. The solution is clean and conceptual, and therefore there is an unexpected flavor. Let $g(n)=\frac{f(n)}{n}$. Notice that the condition becomes $\lfloor mg(mn)\rfloor = mg(m)$, so it holds that $mg(m) \leqslant mg(mn) < mg(m)+1$, which implies that $$g(m) \leqslant g(mn) < g(m)+\frac{1}{m}$$Now we shall show that the sequence $g(1), g(2), \ldots$ is a Cauchy sequence. Indeed, for any $m$, $n$, let us say without loss of generality that $g(m) \leqslant g(n)$. Then, $g(m)\leqslant g(n) \leqslant g(mn)<g(m)+\tfrac{1}{m}$, so $|g(m)-g(n)|<\tfrac{1}{m}$. Thus, $g(1), g(2), \ldots$ satisfies the condition of Cauchy sequences. Now, let $r=\lim_{n\rightarrow \infty} g(n)$. Let $m$ be a positive integer. We have that for any real $\epsilon>0$, there exists a positive integer $k$ such that $|g(mk)-r|<\epsilon$. Yet, we also have that $g(m) \leqslant g(mk) < g(m)+\frac{1}{m}$, so $$|r-g(m)|\leqslant |r-g(mk)| + |g(mk)-g(m)| < \epsilon+\frac{1}{m} \implies |r-g(m)|\leqslant \frac{1}{m}$$Furthermore, if $g(m)>r$, then for all $k\in \mathbb{N}$, $g(mk)-r \geqslant g(m)-r$, which contradicts the fact that $g(1), g(2), \ldots$ approaches $r$. Hence, $$0\leqslant r-g(m)\leqslant \frac{1}{m}$$for all positive integers $m$, or equivalently, $$mr-1 \leqslant f(m) \leqslant mr$$ The rest of the solution deals with the pointwise value trap: if $mr$ is not an integer, then $f(m)=\lfloor mr\rfloor$; in particular, for irrational values of $r$, the only function is $f(n)=\lfloor nr\rfloor$. However, it is possible for either $f(m)=mr$ or $f(m)=mr-1$ to hold for each value of $m$ for which $mr$ is an integer. Let $\mathcal{S}_r$ be the set of positive integers $n$ satisfying $nr \in \mathbb{Z}$. Clearly, if $n\in \mathcal{S}_r$, then all multiples of $n$ are also in $\mathcal{S}_r$. If $\mathcal{S}_r$ is nonempty, then $r$ is rational, and we write $r=\frac{p}{q}$ where $\gcd(p, q)=1$ and $q>0$. Suppose $m\in \mathcal{S}_r$. Note that $\mathcal{S}_r$ is precisely the set of all multiples of $q$. If $f(m)=mr$, then for all positive integers $k$, we have that $r=g(m) \leqslant g(mk) \leqslant r$, so $f(mk)=mkr$. If $f(m)=mr-1$, then for all positive integers $k$, we must have that $f(mk)=mkr-1$, as otherwise, if $f(mk)=mkr$, $$\left\lfloor \frac{f(mk)}{k} \right\rfloor = \left\lfloor \frac{mkr}{k}\right\rfloor = mk \neq f(m)$$. Thus, if there exists an element $x \in \mathcal{S}_r$ with $f(x)=xr-1$, then $f(q)=qr-1$ (since $f(q)=qr$ would imply $f(x)=xr$), and consequently, $f(kq)=kqr-1$ for all $k\in \mathbb{N}$. We have thus shown that all possible functions are of the form $$f(n)=\lfloor nr\rfloor$$or $$f(n) = \lceil nr \rceil - 1$$Now we shall show that both of these families of functions work. For the first function, we use the following lemma: Lemma: If $a,b \in \mathbb{Z}$, then $a\leqslant x<b \iff a\leqslant \lfloor x \rfloor < b$. Proof: $\lfloor x \rfloor$ is a nondecreasing function, so $a=\lfloor a \rfloor \leqslant \lfloor x \rfloor \leqslant \lfloor b \rfloor= b$. We cannot have $\lfloor x \rfloor = b$ though, as that would imply $x \geqslant b$. Hence, we have shown $a\leqslant x<b \implies a\leqslant \lfloor x \rfloor < b$. For the other direction, note that if $x\geqslant b$, then $\lfloor x \rfloor \geqslant \lfloor b \rfloor = b$, and if $x<a$, then $\lfloor x \rfloor \leqslant \lfloor a \rfloor =a$, and similarly as before, $\lfloor x \rfloor \neq a$, so the result follows. Hence, \begin{align*} & \phantom\implies \lfloor mr \rfloor \leqslant mr < \lfloor mr\rfloor + 1\\ & \implies \lfloor mr \rfloor \cdot n \leqslant mnr < \lfloor mr \rfloor \cdot n + n\\ & \implies \lfloor mr \rfloor \cdot n \leqslant \lfloor mnr \rfloor < \lfloor mr \rfloor \cdot n +n \\ & \implies \lfloor mr \rfloor \leqslant \frac{\lfloor mnr \rfloor}{n} < \lfloor mr \rfloor +1\\ & \implies \left\lfloor \frac{f(mn)}{n} \right\rfloor = \left\lfloor \frac{\lfloor mnr \rfloor}{n} \right\rfloor = \lfloor mr \rfloor = f(m) \end{align*} For the second function, the function can be written as $f(n) = \lfloor nr \rfloor $ for $n\not\in \mathcal{S}_r$, and $f(n)=nr-1$ for $n\in \mathcal{S}_r$. If $mn \not\in \mathcal{S}_r$, then $m\not\in \mathcal{S}_r$ and $n\not\in \mathcal{S}_r$, so $\lfloor \tfrac{f(mn)}{n}\rfloor = f(m)$ holds similarly as before. If $mn \in \mathcal{S}_r$, then we have two cases: Case 1: $m \in \mathcal{S}_r$. In this case, $$\left\lfloor \frac{f(mn)}{n} \right\rfloor = \left \lfloor \frac{mnr-1}{n}\right\rfloor = mr-1 = f(m)$$ Case 2: $m\not \in \mathcal{S}_r$ (but once again, $mn \in \mathcal{S}_r$). In this case, $$\left\lfloor \frac{f(mn)}{n} \right\rfloor = \left\lfloor \frac{mnr-1}{n}\right\rfloor = \left\lfloor \frac{mnr}{n}\right\rfloor = \lfloor mr \rfloor = f(m)$$since $n\nmid mnr$. Thus, the solution set is $\boxed{f(n)\equiv\lfloor nr\rfloor}$ and $\boxed{f(n) \equiv \lceil nr \rceil - 1}$ for some arbitrary real number $r$. $\blacksquare$
27.06.2022 20:11
The answer is $f(n) = \lfloor an \rfloor$ or $f(n) = \lceil an \rceil - 1$ where $a$ is any real number. It can be checked that these work, so it suffices to show that everything is of this form. First, replace $f(n)$ with $f(n) - nf(1)$ (which also works) so that we have $f(1) = 0$ which means that we have $0 \leqslant f(n) < n$. Let $I_n$ denote the interval $\left [ \frac{f(n)}{n}, \frac{f(n) + 1}{n} \right)$. By the problem condition, we have that $I_{kn} \in I_n$. So consider the intervals $I_1, I_2, I_4, I_8, I_{16}, \cdots$. Construct a number $b$ such that after the decimal point, its $k$th digit in binary is $0$ if $I_{2^{k}}$ is in the first half of $I_{2^{k+1}}$ and $1$ if its in the second half. This number $b$, by construction is the unique number that lies in all of these intervals. Note that since both $I_x, I_y$ contain $I_{xy}$, any two intervals must have nonempty intersection and so every interval must contain $b$. But there can also be the possibility that $b$ is a number that this tends to from behind, in which case we have $f(n) = \lfloor bn \rfloor$ when $bn$ is not an integer but $f(n) = \lfloor bn \rfloor - 1$ when it is an integer, which can be written as $f(n) = \lceil bn \rceil - 1$. From this, (adding back the $nf(1)$), we obtain the claimed solution set.$\blacksquare$ oops @below, fixed
27.06.2022 20:17
not exactly, you're missing $f(n)=n-1$ as well as other similar solutions (b=0.99999999999999999... is valid)
29.06.2022 16:13
Let $P(m,n)$ be the assertion. $P(1,n) \Longrightarrow \left\lfloor \frac{f(n)}{n} \right\rfloor=f(1)$ We have $nf(1)\le f(n)<f(n)+n$ Let $f(1)=c$ $P(m,n)\Longrightarrow \left\lfloor \frac{f(mn)}{n} \right\rfloor=f(m)$ We have $nf(m)\le f(mn)< nf(m)+n$ Beacause $f(n)\ge cn$, we have $cmn\le nf(m)\le f(mn)<cmn+n\le nf(m)+n\dots (1)$ Subs $n=1$ to $(1)$, we have $cm\le f(m)< cm+1 \Longrightarrow f(m)=cm$ for all $c$ natural number any feedback?
29.06.2022 16:35
Jufri wrote: any feedback? well it's wrong
05.07.2022 19:57
Solution: Assume there exists two positive intergers $m,n$ satisfy $\frac{f(m)+1}{m} \le \frac{f(n)}{n}$. We already have $\left\lfloor \frac{f(mn)}{n} \right\rfloor=f(m)$ $=> f(m).n+n-1 \ge f(mn)$. Then $f(n).m \ge f(m).n+n > f(mn)$ $=> f(n) > \frac{f(mn)}{m}$ Contradiction. Therefore, $\frac{f(m)+1}{m} > \frac{f(n)}{n}$ for all positive interger $m,n$. Now, let $S$ be the supremum of $\frac{f(n)}{n}$, $I$ be the infimum of $\frac{f(m)+1}{m}$. There are three cases $1)$$ $$ $ $S>\frac{f(n)}{n}$ for all $n \in Z^{+}$. Let $a=S$, we have $\frac{f(m)+1}{m} \ge a > \frac{f(n)}{n}$ for all positive interger $m,n$ $=>$ $f(n) \equiv \lceil an \rceil - 1$ $2)$$ $$ $ $I<\frac{f(m)+1}{m}$ for all $n \in Z^{+}$. Let $a=I$, we have $\frac{f(m)+1}{m} > a \ge \frac{f(n)}{n}$ for all positive interger $m,n$ $=>$ $f(n) \equiv \lfloor an \rfloor$ $3)$ exist $m_0,n_0 \in Z^{+}$ satisfies$ S=\frac{f(n_0)}{n_0}$ and $I=\frac{f(m_0)+1}{m_0}$, then $S<I$. Let $a =\frac{S+I}{2}$, we have $\frac{f(m)+1}{m} > a > \frac{f(n)}{n}$ $=>$ $f(n) \equiv \lfloor an \rfloor \equiv \lceil an \rceil - 1$ Thus, $f(n) \equiv \lceil an \rceil - 1$ or $f(n) \equiv \lfloor an \rfloor$ for any $a \in R$
05.07.2022 22:11
Dan37kosothangnao wrote: Solution: Assume there exists two positive intergers $m,n$ satisfy $\frac{f(m)+1}{m} \le \frac{f(n)}{n}$. We already have $\left\lfloor \frac{f(mn)}{n} \right\rfloor=f(m)$ $=> f(m).n+n-1 \ge f(mn)$. Then $f(n).m \ge f(m).n+n > f(mn)$ $=> f(n) > \frac{f(mn)}{m}$ Contradiction. Therefore, $\frac{f(m)+1}{m} > \frac{f(n)}{n}$ for all positive interger $m,n$. Consequently, there exists $a \in R$ satisfies $\frac{f(m)+1}{m} > a > \frac{f(n)}{n}$ for all positive interger $m,n$ which gives $f(n) = \lfloor an \rfloor$ for all $n \in Z^{+}$. No. You miss solutions. Read previous posts before posting.
06.07.2022 11:39
ZETA_in_olympiad wrote: Dan37kosothangnao wrote: Solution: Assume there exists two positive intergers $m,n$ satisfy $\frac{f(m)+1}{m} \le \frac{f(n)}{n}$. We already have $\left\lfloor \frac{f(mn)}{n} \right\rfloor=f(m)$ $=> f(m).n+n-1 \ge f(mn)$. Then $f(n).m \ge f(m).n+n > f(mn)$ $=> f(n) > \frac{f(mn)}{m}$ Contradiction. Therefore, $\frac{f(m)+1}{m} > \frac{f(n)}{n}$ for all positive interger $m,n$. Consequently, there exists $a \in R$ satisfies $\frac{f(m)+1}{m} > a > \frac{f(n)}{n}$ for all positive interger $m,n$ which gives $f(n) = \lfloor an \rfloor$ for all $n \in Z^{+}$. No. You miss solutions. Read previous posts before posting. I have editted it. any problems?
06.07.2022 15:44
It has been brought to my attention that there is no complete solution on this thread. Hence, I shall present one that was given 7 points on TSTST.
06.07.2022 16:46
Bruh.. I cannot even understand why $$\left \lfloor \dfrac{\lfloor xn \rfloor }{n} \right \rfloor = \lfloor x \rfloor $$holds for any $x\in \mathbb R$ and $n \in \mathbb N$. Induction? Inequalities?
06.07.2022 17:11
@above Note that \[ \frac{xn - 1}{n} < \frac{\lfloor xn \rfloor}{n} \le x \]and thus \[ \left \lfloor \frac{xn - 1}{n} \right \rfloor \le \left \lfloor \frac{\lfloor xn \rfloor}{n} \right \rfloor \le \lfloor x \rfloor \] Now, if $\left \lfloor x - \frac{1}{n} \right \rfloor = \lfloor x \rfloor$, we are done. Else, then we must have $k \le x < k + \frac{1}{n} \implies nk \le nx < nk + 1 \implies \lfloor nx \rfloor = nk$ for some $k \in \mathbb{Z}$. However, \[ \left\lfloor \frac{\lfloor xn \rfloor}{n} \right \rfloor = \left \lfloor \frac{kn}{n} \right \rfloor = k = \lfloor x \rfloor \]
06.07.2022 19:09
admechii wrote: The solution set is trivial to find! My reaction to that information:
Hence, $\lfloor f(10^k)\rfloor = \lfloor 10^kq\rfloor$. By the statement, we can rewrite it as $nf(m) \leq f(mn) \leq nf(m)+n-1$. By swapping $m,n$, we get that $mf(n) -n+1 \leq nf(m) \leq mf(n)+m-1~~ \forall m,n \in \mathbb N.$ Therefore, $$\frac{m(f(n)+1)}{n}-\frac{m-1}{n} \leq f(m) \leq \frac{mf(n)}{n} + \frac{m-1}{n}.$$Substitute $n = 10^k$, we have $nq-1 = 10^kq-1<f(n) \leq 10^kq = nq$. Hence, $mq - \frac{m-1}{n}< f(m) \leq mq + \frac{m-1}{n}$ for all $m \in \mathbb N, n = 10^k$. By choosing large $k$, we get that $ mq -1\leq f(m) \leq mq$. If $q$ is irrational, $f(m) = \lfloor mq \rfloor$ for all $m \in \mathbb{N}$. If $q = \frac{r}{s}$ is rational $(r,s \in \mathbb{N}$ are coprime), we have $mq \in \mathbb{N} \iff s|m$. Therefore, if $s \nmid m,~ mq \not\in \mathbb{Z},~ f(m) = \lfloor mq \rfloor = \lceil mq \rceil -1$. Now, if $m = sl, l \in \mathbb N$, we have $f(sl) \in \{rl-1,rl\}$. Note that $\left\lfloor \frac{f(sl)}{l} \right\rfloor=f(s)$. Hence, $f(s) = r \implies f(sl) = rl = \lfloor q(sl)\rfloor$, and $f(s) = r-1 \implies f(sl) = rl-1 = \lceil q(sl) \rceil -1$ for all $l$. Hence, there exists a real number $q$ such that $f(n) = \lfloor nq \rfloor$ for all $n \in \mathbb{N}$, or $f(n) = \lceil nq \rceil -1$ for all $n \in \mathbb{N}$. I assume that I check these answers, and this proof is complete.
08.07.2022 10:03
Motivation to find the solution set: Notice that the solution to $\frac{f(mn)}{n} = f(m)$ is all linear functions so by induction on the number of floor functions in the question and answer, we are done.
08.07.2022 17:02
admechii wrote: This is a standard $\mathbb{N} \rightarrow \mathbb{Z}$ functional equation with a surprise. In my opinion, it has some positive qualities not present in usual $\mathbb{N} \rightarrow \mathbb{Z}$ functional equations. The statement is clean and memorable. The solution is clean and conceptual, and therefore there is an unexpected flavor. :eyes:
28.10.2022 10:59
Rearrange the condition as such: \[nf(m) \le f(mn) < nf(m)+n\]and similarly by swapping $m,n$, \[mf(n) \le f(mn) < mf(n)+m\]Comparing these two equations, we see that for such a $f(mn)$ to exist, $mf(n)+m \ge nf(m) \implies \frac{f(n)}{n} + \frac{1}{n} \ge \frac{f(m)}{m}$. Let $g(n)=\frac{f(n)}{n}$, the above condition implies that \[|g(m)-g(n)| < \frac{1}{\min(m,n)}\]Hence, the sequence $g(1),g(2) \cdots$ is Cauchy, so it converges to a limit, let's say $r$. Now, fix an $m$ and choose an $n$ such that $(r-\varepsilon)mn< f(mn) < (r+\varepsilon)mn$, where $\varepsilon$ is some small real number. Hence, $(r-\varepsilon)m<\frac{f(mn)}{n} < (r+\varepsilon)m$ If $rm$ is not an integer, then choosing $\varepsilon$ to be small enough we get that $f(m) = \left \lfloor \frac{f(mn)}{n} \right \rfloor = \lfloor rm \rfloor$. Otherwise, $f(m)=rm \text{ or } rm-1$ Case 1: $f(m) = rm$ I claim that $f(n) = \lfloor rn \rfloor$ in this case. Indeed, by the above we must have that for all sufficiently large $n$, $f(mn) \ge rmn$, else $f(m) = rm-1$. For any other integer $k$, if $rk$ is not an integer then we are good. If $rk$ is an integer we can simply choose $n=n'k$, and set $n'$ to be arbitrarily large. In this way, we get that $f(k) \ge rk \implies f(k) = rk = \lfloor rk \rfloor$ so we are done. Case 2: $f(m) = rm-1$ I claim that $f(n)=\lceil rn \rceil -1$ in this case. Similarly, we must have for all sufficiently large $n$, $f(mn) < rmn$, otherwise $f(m)=rm$. For some other integer $k$, we are again fine if $rk$ is not an integer, if it is we set $n=n'k$ once again, thus obtaining that $f(k) < rk \implies f(k) = rk-1 = \lceil rk \rceil -1$ as desired. All that is left is to check that the above families of solutions work. For $f(n) = \lfloor rn \rfloor$, observe that \[\left\lfloor \frac{f(mn)}{n} \right\rfloor = \left \lfloor \frac{\lfloor rmn \rfloor}{n} \right \rfloor = \left \lfloor \frac{\lfloor \lfloor rm \rfloor \cdot n + \{rm\} \cdot n\rfloor}{n} \right \rfloor = \lfloor rm \rfloor + \left \lfloor \frac{\lfloor\{rm\} \cdot n \rfloor}{n} \right \rfloor = \lfloor rm \rfloor = f(m) \]where the second last step follows from the observation that the thing inside the floor is bounded between $0$ and $1$. As for $f(n) = \lceil rn \rceil -1$, we see that it holds when $rmn$ is not an integer by the argument above, and when $rmn$ is an integer, \[\left\lfloor \frac{f(mn)}{n} \right\rfloor = \left\lfloor \frac{rmn-1}{n} \right\rfloor = \left\lfloor rm - \frac{1}{n} \right\rfloor = \lceil rm \rceil -1\]since the fractional part of $rm$ is either $0$ or at least $\frac{1}{n}$ (since $rmn$ is an integer), and the conclusion follows in either case. Therefore, the only solutions are $\boxed{f(n) = \lfloor rn \rfloor} \text{ and } \boxed{f(n)=\lceil rn \rceil -1}$ where $r$ can be any real number.
01.12.2022 19:22
Let $P(m, n)$ denote the given assertion. Consider $P((k-1)!, k)$ for positive integers $k$: we have $$\left\lfloor\frac{f(k!)}{k}\right\rfloor = f((k-1)!),$$which can be written as $$\frac{f(k!)}{k} = f((k-1)!) + d_k,$$where $0 \le d_k < 1$. Dividing by $(k-1)!$ and substituting $g(n) = \frac{f(n)}{n}$ gives $$g(k!) = g((k-1)!) + \frac{d_k}{(k-1)!}.$$Claim: $\lim_{k\to\infty} g(k!)$ exists. Proof: We have $$g(k!) = g(1) + \sum_{i=1}^k \frac{d_i}{(i-1)!}$$by repeatedly applying the above equation. Now we just have to show that the sum $$\sum_{i=1}^\infty \frac{d_i}{(i-1)!}$$converges, which is clear since it is a sum of nonnegative terms and bounded above by $\sum_{i=1}^\infty \frac{1}{(i-1)!} = e$. Let $r = \lim_{k\to\infty} g(k!)$. Then for any positive integer $x$ and $y \ge x$, $P\left(x, \frac{y!}{x}\right)$ gives $$\lfloor xg(y!)\rfloor=\left\lfloor\frac{xf(y!)}{y!}\right\rfloor = f(x).$$If $y$ is sufficiently large, then the condition $y \ge x$ is met, and in addition, $g(y!)$ could be arbitrarily close to $r$, so $xg(y!)$ could be arbitrarily close to $rx$. If the limit $r$ is actually achieved by some $g(k_0!)$, then since $g((k-1)!) \le g(k!)$ for all $k$, $g(k!) = r$ for all $k \ge k_0$. Setting a sufficiently large $y$ in this case would imply $f(x) = \lfloor rx\rfloor$. If the limit $r$ is never achieved, then the situation is similar unless $rx$ is an integer, in which case setting a large $y$ will give $xg(y!)$ just under $rx$, giving $f(x) = rx - 1$. Combining this with the case where $rx$ is not an integer gives the solution $f(x) = \lceil rx \rceil - 1$. See previous posts for proof that these two solutions work.
18.06.2023 18:03
The answer is $f(n)=\lfloor rn \rfloor$ and $f(n)=\lceil rn \rceil-1$, where $r$ is any real number. Note that for $r$ irrational these two functions are identical. It is easy to check that these work. Let the assertion be $P(m,n)$. The key idea is to prove that $\frac{f(n)}{n}$ has a limit as $n \to \infty$. To prove this, I will show that for any $\varepsilon>0$, there exists some $N$ such that $\frac{f(N)}{N},\frac{f(N+1)}{N+1},\ldots$ lie in an interval of size $\varepsilon$. Pick positive integers $a<b$. From $P(a,b)$ we obtain $bf(a) \leq f(ab) < bf(a)+b$, and from $P(b,a)$ we obtain $af(b) \leq f(ab) < af(b)+a$. Therefore, we must have $$bf(a)+b>af(b) \implies \frac{f(a)}{a}>\frac{f(b)}{b}-\frac{1}{a},$$and also $$af(b)+a>bf(a) \implies \frac{f(a)}{a}<\frac{f(b)}{b}+\frac{1}{b}<\frac{f(b)}{b}+\frac{1}{a},$$so taking $a$ such that $\tfrac{1}{a}<\tfrac{\varepsilon}{2}$ will work. Now let $r$ be the aforementioned limit. We must have $\frac{f(a)}{a} \in \left[r-\frac{1}{a},r\right] \iff f(a) \in [ar-1,ar]$ for all $a \in \mathbb{Z}^+$: the lower bound comes from the first inequality, and is closed because $f(b)/b$ doesn't ever need to actually equal $L$, just approach it. The upper bound comes from $f(a)/a<f(b)/b+1/b$ and taking $b \to \infty$ so that the second term on the RHS vanishes. Therefore we actually find that if $rn$ is not an integer, we must always have $f(n)=\lfloor rn \rfloor=\lceil rn \rceil-1$, but if it is an integer then $f(n) \in \{rn,rn-1\}=\{\lfloor rn\rfloor, \lceil rn \rceil-1\}$. It therefore remains to deal with the "pointwise trap". Note that this "trap" only exists if $r$ is rational, since otherwise $rn$ is never actually an integer and our two function definitions are equivalent. Suppose that $r:=p/q$ is rational (where $\gcd(p,q)=1$) and that there exists $n$ such that $f(qn)=pn-1$. Then by $P(q,n)$, we find that $$f(q)=\left\lfloor \frac{pn-1}{n}\right\rfloor=p-1.$$Using this, by $P(q,m)$ where $m \in \mathbb{Z}^+$, we obtain $$f(qm)<mf(q)+m=m(p-1)+m=mp \implies f(qm)=pm-1.$$Since $rx \in \mathbb{Z}^+ \iff q \mid x$, this implies that $f(n)=\lceil rn\rceil -1$ for all $n$. On the other hand, if no such $n$ exists, then we readily obtain $f(n)=\lfloor rn \rfloor$ for all $n$, which produces our two desired solution sets. $\blacksquare$
25.12.2023 07:26
We have $$f(m)\le\frac{f(mn)}n<f(m)+1$$$$nf(m)\le f(mn)<nf(m)+n$$Switch $m$ and $n$: $$mf(n)\le f(mn)<mf(n)+m$$Then, $$nf(m)<mf(n)+m$$Divide by $mn$: $$\frac{f(m)}m<\frac{f(n)}n+\frac1n$$Again switch $m$ and $n$: $$\frac{f(n)}n<\frac{f(m)}m+\frac1m$$Then, $$\frac{f(m)}m-\frac1n<\frac{f(n)}n<\frac{f(m)}m+\frac1m$$For $n\ge m$: $$\frac{f(m)}m-\frac1m<\frac{f(n)}n<\frac{f(m)}m+\frac1m$$so we see that $\frac{f(n)}n$ is a Cauchy sequence and thus has real limit $L$. Now, consider again $$\frac{f(m)}m-\frac1n<\frac{f(n)}n<\frac{f(m)}m+\frac1m$$if we send $m$ to infinity then we get $$L-\frac1n\le\frac{f(n)}n\le L$$If we ever had $\frac{f(n)}n=L$ for some $n$, we could then plug in that value instead for $m$ and get $$L-\frac1n<\frac{f(n)}n<L+\frac1m$$In particular, we would have $$L-\frac1n<\frac{f(n)}n\le L$$so $$Ln-1<f(n)\le Ln$$Then we would get that $f(n)=\lfloor Ln\rfloor$. Otherwise, $\frac{f(n)}{n}=L$ can never hold, so $$L-\frac1n\le\frac{f(n)}n<L$$and thus $$Ln-1\le f(n)<Ln$$Then $f(n)=\lceil Ln\rceil-1$. Thus, we have solutions $f(n)=\lfloor Ln\rfloor$ and $f(n)=\lceil Ln\rceil-1$. We claim both work. We want to prove that $nf(m)\le f(mn)<nf(m)+n$ for each of these solutions. For the first, this becomes $n\lfloor Lm\rfloor\le \lfloor Lmn\rfloor<n\lfloor Lm\rfloor+n$. The former inequality follows from $n\lfloor Lm\rfloor\le Lmn$ and the LHS is an integer. The latter follows from $\lfloor Lmn\rfloor \le Lmn$ and $Lm<\lfloor Lm\rfloor+1$ (multiply the last inequality by $n$). Now, for the second solution, our desired claim becomes $n\lceil Lm\rceil-n\le \lceil Lmn\rceil-1<n\lceil Lm\rceil$. This is equivalent to $n\lceil Lm\rceil-n<\lceil Lmn\rceil\le n\lceil Lm\rceil$ and then negating the entire thing and replacing $L$ with $-L$ makes the inequality the same as the inequality we proved for the first solution, thus we are done for this solution as well.
12.01.2025 22:43
$P(n,1): \left\lfloor\frac{f(n)}{n}\right\rfloor = f(1)$ This means we can write $f(n)$ as $nf(1) + g(n)$ where $g(n)$ is a non-negative integer that is smaller than $n$. The original equation will be: $$\left\lfloor\frac{mnf(1) + g(mn)}{n} \right\rfloor = mf(1) + g(m)$$$$\left\lfloor\frac{g(mn)}{n}\right\rfloor = g(m)$$Claim: $g(n-1) \leq g(n) \leq g(n-1) + 1$ Proof: $P(n-1, n): \left\lfloor\frac{g(n(n-1))}{n}\right\rfloor = g(n-1)$ $P(n, n-1): \left\lfloor\frac{g(n(n-1))}{n-1}\right\rfloor = g(n)$ Notice that since $n-1 < n$, this implies $g(n-1) \leq g(n)$. Also, we have $g(n(n-1)) < n(g(n-1)+1)$ and $g(n(n-1)) \geq (n-1)g(n)$, thus: $$n(g(n-1)+1) > (n-1)g(n)$$$$g(n-1) + 1> \frac{(n-1)g(n)}{n} $$Let $k = g(n) - g(n-1)$ $$g(n-1)+1 > \frac{(n-1)(g(n-1)+k)}{n}$$$$1 > k - \frac{g(n-1)}{n}$$Since $g(n-1) < n$, we have that $k \leq 1$ and thus $g(n) \leq g(n-1) + 1$ and we are done with the claim. Let $h(n) = \frac{g(n)}{n}$ and $e = \lim_{n\to\infty}h(n)$ Claim: $e$ actually exists. Proof: Suppose it does not exist. Then there exist a constant $c$ s.t. for any integer k, there exist $m$ and $n$ where $h(m) - h(n) > c$ and $m,n>k$. Let $p$ be an integer where $p > \frac{3}{c}$, and let $ap$, $bp$ be the smallest multiple of $p$ greater than or equal to $m$ and $n$ respectively. $P(p, a): \left\lfloor\frac{g(ap)}{a} \right\rfloor = g(p)$ $\left\lfloor\frac{g(m) - p}{a} \right\rfloor \leq g(p)$ $\left\lfloor (p\frac{a-1}{a})\frac{g(m)}{p(a-1)} - \frac{p}{a} \right\rfloor \leq g(p)$ $\left\lfloor (p\frac{a-1}{a})h(m) - \frac{p}{a}\right\rfloor \leq g(p)$ $\left\lfloor (p\frac{a-1}{a})(h(n) + c) - \frac{p}{a}\right\rfloor \leq g(p)$ $P(p, b): \left\lfloor\frac{g(bp)}{b} \right\rfloor = g(p)$ $\left\lfloor\frac{g(n) + p}{b} \right\rfloor \geq g(p)$ $\left\lfloor (p\frac{b+1}{b})\frac{g(n)}{p(b+1)} - \frac{p}{a} \right\rfloor \geq g(p)$ $\left\lfloor (p\frac{b+1}{b})h(n) - \frac{p}{b}\right\rfloor \geq g(p)$ Thus we have $\left\lfloor (p\frac{a-1}{a})(h(n) + c) - \frac{p}{a}\right\rfloor \leq \left\lfloor (p\frac{b+1}{b})h(n) - \frac{p}{b}\right\rfloor$ But notice that $\frac{a-1}{a}$, $\frac{p}{a}$, $\frac{b+1}{b}$ and $\frac{p}{b}$ tends towards $0$ as $a$, $b$ tends towards infinity. Since we can make $a$, $b$ arbritarily large, these tend towards 0 and we are left with $\left\lfloor (p)(h(n) + c) \right\rfloor \leq \left\lfloor (p)h(n) \right\rfloor$, but this is not true since $cp > 3$. Thus the claim is true. Claim: $g(n) \leq en$. Proof: assume there exists $k$ s.t. $g(k) > ek$ $P(k,n): \left\lfloor \frac{g(nk)}{n} \right\rfloor = g(k)$ $\left\lfloor kh(nk) \right\rfloor = g(k)$ $\left\lfloor k(e + \epsilon) \right\rfloor = g(k)$ Notice that as $n$ increases, $|\epsilon|$ decreases because $e$ is the limit of $h(n)$ as it tends towards infinity. Thus, if we assume $ek$ is not an integer for sufficiently large $n$, we will have $g(k) = \left\lfloor ek \right\rfloor$ which is a contradiction. If $ek$ is an integer, we have $g(k) \geq ek +1$, but for sufficiently large $n$, we will have $g(k) = ek$ or $ek-1$, both of which give a contradiction, thus $g(n) \leq en$ and the claim is true. Claim: $en - g(n) \leq 1$ Proof: assume there exists $k$ s.t. $ek - g(k) > 1$. Similar to the previous claim's proof, we have $\left\lfloor k(e + \epsilon) \right\rfloor = g(k)$ but now we know that $\epsilon$ is always non-positive, thus if we make $|\epsilon|$ extremely small, when $ek$ is not an integerwe will get $g(k) = \left\lfloor ek \right\rfloor$ which is a contradiction. If $ek$ is an integer, then we will get $g(k) = ek$ or $ek-1$, both of which lead to a contradiction, thus the claim is true. Finally, we get $g(n) = \left\lfloor en \right\rfloor$ or $\left\lceil en \right\rceil - 1$. Notice that the values are only different when $ne$ is an integer (i.e. $e$ is a rational and $n$ is a multiple of the denominator). If $e$ is not a rational, we are done. Else, let $k$ be the denomiator of $e$. Suppose $g(k) = ek$ $P(k,n): \left\lfloor \frac{g(nk)}{n} \right\rfloor = g(k)$ $\left\lfloor \frac{g(nk)}{n} \right\rfloor = ek$ If $g(nk) = nek - 1$, then the RHS will be $ek-1$ which is a contradiction, thus $g(nk) = nek$. (If $g(k) = ek-1$, the proof is exactly the same but we will get $g(nk) = ek - 1$, since otherwise, the RHS will be $ek$ while the LHS will be $ek-1$). Therefore $g(n) = \left\lfloor en \right\rfloor$ or $g(n) = \left\lceil en \right\rceil - 1$ (without any pointwise trap). Since $f(n) = nf(1) + g(n)$, we have that $f(n) = \left\lfloor \alpha n \right\rfloor$ or $f(n) = \left\lceil \alpha n \right\rceil - 1$ for any real number $\alpha$. (I will not do check since I am lazy)