Find all monic polynomials $f$ with integer coefficients satisfying the following condition: there exists a positive integer $N$ such that $p$ divides $2(f(p)!)+1$ for every prime $p>N$ for which $f(p)$ is a positive integer. Note: A monic polynomial has a leading coefficient equal to 1. (Greece - Panagiotis Lolas and Silouanos Brazitikos)
Problem
Source: Balkan MO 2016, Problem 3
Tags: polynomial, number theory
07.05.2016 16:14
Clearly $f(p) < p$ for all large enough $p$ and hence $f$ must be linear so it is of the form $x+c$. Clearly then $c$ is negative so let $f(x) = x - k$ where $k$ is some constant. Then the condition rewrites into $2(p-k)! \equiv -1 \pmod p$ but one has that $(p-1)! \equiv -1 \pmod p$ by Wilson's and thus it is equivalent to $2 \equiv (-1)^{k} k! \pmod p$ for all large enough $p$ in which it immediately follows that $k = 2$ by taking a sufficiently large prime. Hence the only such polynomials are $x-2$.
07.05.2016 16:15
fattypiggy123 wrote: Clearly $f(p) < p$ for all large enough $p$ and hence $f$ must be linear so it is of the form $x+c$. Clearly then $c$ is negative so let $f(x) = x - k$ where $k$ is some constant. Then the condition rewrites into $2(p-k)! \equiv -1 \pmod p$ but one has that $(p-1)! \equiv -1 \pmod p$ by Wilson's and thus it is equivalent to $2 \equiv (-1)^{k} k! \pmod p$ for all large enough $p$ in which it immediately follows that $k = 2$ by taking a sufficiently large prime. Hence the only such polynomials are $x-2$. i DONT UNDERSTAND WHY $f$ must be linear?
07.05.2016 16:17
If $f$ is not linear then when it is sufficiently large, $f(p) > p$ and hence $p$ will divide $f(p)!$ and thus $2f(p)! + 1$ can't be divisible by $p$.
07.05.2016 16:20
fattypiggy123 wrote: If $f$ is not linear then when it is sufficiently large, $f(p) > p$ and hence $p$ will divide $f(p)!$ and thus $2f(p)! + 1$ can't be divisible by $p$. If $f(p) > p$ it doesnt mean $p$ divides $f(p)$
07.05.2016 16:23
But it will mean that $p$ divides the factorial of $f(p)$.
07.05.2016 16:23
Murad.Aghazade wrote: fattypiggy123 wrote: If $f$ is not linear then when it is sufficiently large, $f(p) > p$ and hence $p$ will divide $f(p)!$ and thus $2f(p)! + 1$ can't be divisible by $p$. If $f(p) > p$ it doesnt mean $p$ divides $f(p)$ Read the post carefully, he said $p\mid f(p)!$
07.05.2016 16:23
Who can help me if $f=a_n\cdot x^n+...+a_1\cdot x+a_0$ If f is monic then $a_0=0$ or what????
07.05.2016 16:24
I think you didn't see/don't understand the exclamation mark sign For your reference: https://en.wikipedia.org/wiki/Factorial
07.05.2016 16:25
Murad.Aghazade wrote: Who can help me if $f=a_n\cdot x^n+...+a_1\cdot x+a_0$ If f is monic then $a_0=0$ or what???? fattypiggy123 wrote: I think you didn't see/don't understand the exclamation mark sign For your reference: https://en.wikipedia.org/wiki/Factorial I dont understand what monic mean???
07.05.2016 16:27
Monic means that $a_n = 1$.
07.05.2016 16:44
fattypiggy123 wrote: Clearly $f(p) < p$ for all large enough $p$ and hence $f$ must be linear so it is of the form $x+c$. Clearly then $c$ is negative so let $f(x) = x - k$ where $k$ is some constant. Then the condition rewrites into $2(p-k)! \equiv -1 \pmod p$ but one has that $(p-1)! \equiv -1 \pmod p$ by Wilson's and thus it is equivalent to $2 \equiv (-1)^{k} k! \pmod p$ for all large enough $p$ in which it immediately follows that $k = 2$ by taking a sufficiently large prime. Hence the only such polynomials are $x-2$. the idea is very good try to fixed because $x-2$ is not solution but $ x-3$.
07.05.2016 16:47
Oops your right It is $2 \equiv (-1)^{k-1} (k-1)! \pmod p$ instead which gives us $x-3$ instead of $x-2$.
07.05.2016 17:02
fattypiggy123 wrote: Clearly $f(p) < p$ for all large enough $p$ and hence $f$ must be linear so it is of the form $x+c$. Clearly then $c$ is negative so let $f(x) = x - k$ where $k$ is some constant. Then the condition rewrites into $2(p-k)! \equiv -1 \pmod p$ but one has that $(p-1)! \equiv -1 \pmod p$ by Wilson's and thus it is equivalent to $2 \equiv (-1)^{k} k! \pmod p$ for all large enough $p$ in which it immediately follows that $k = 2$ by taking a sufficiently large prime. Hence the only such polynomials are $x-2$. Great solution i understand it finally
07.05.2016 17:06
Does exam finish???
07.05.2016 17:11
Yes it finished about an hour ago.
07.05.2016 17:11
Yes, for more information about the exam, you may follow this link http://www.bmo2016.al/
07.05.2016 17:21
It tooks me 15 minutes to solve this problem Quite nice problem
07.05.2016 17:43
If $\text{deg}(f)\ge 2$,then $f(p)>p$ for $p\to\infty$ and so $p\nmid 2(f(p)!)+1$.Thus $\text{deg}(f)=1$.Let $f(x)=x+a$.If $a\ge 0$ then $f(p)\ge p$ and so $p\nmid 2(f(p)!)+1$.Thus $a<0$ and so $f(x)=x-t$ for some $t>0$.If $t=1$,by Wilson's Theorem we have $f(p)!\equiv -1\pmod{p}$ for any prime and so $p\nmid 2(f(p)!)+1$.For $t=2$ we have $f(p)!\equiv \frac{(p-1)!}{p-1}\equiv \frac{-1}{-1}\equiv 1\pmod{p}$ so $p\nmid 2(f(p)!)+1$ for $p>3$. Now $t=3$ works since $(p-3)!\equiv \frac{(p-2)!}{p-2}\equiv \frac{1}{-2}\equiv -\frac{1}{2}\pmod{p}$ and so $p\mid 2(f(p)!)+1$ for any prime number $p$. For $t>3$ we would have $(p-t)!\equiv (p-3)!\pmod{p}$ or $(p-t+1)(p-t+2)\cdot...\cdot (p-3)\equiv 1\pmod{p}$ for any large enough prime $p$ and so $(-1)^{\text{something}}\cdot 3\cdot 4\cdot...\cdot (t-1)-1\equiv 0\pmod{p}$ which is not true for $p\to\infty$ since $p$ would be greater than $(-1)^{\text{something}}\cdot 3\cdot 4\cdot...\cdot (t-1)-1$. Therefore $t=3$ and so $\boxed{f(x)=x-3.}$
07.05.2016 18:03
Is this from the Senior BMO?
07.05.2016 21:21
Karamata wrote: Is this from the Senior BMO? Yes for senior BMO.
08.05.2016 02:26
This problem was proposed by Greece Panagiotis Lolas and me (Silouanos Brazitikos)
08.05.2016 16:24
I agree with it being a cute problem, but I would say it is heavily misplaced for a BMO 3 (no offence to the author, I enjoyed the problem) and it would be better off for a BMO 1; that said, here is my sketch. We see that $f$ is Monic so if it has degree larger than $1$ then $f(p)>p$ for a sufficiently large prime $p$. Now, clearly we get that $p$ doesn't divide $2(f(p))!+1$ as it divides $f(p)!$. Therefore, $f(p)<p$. Now, we let $f(X)=X-a$ for some positive integer $a$. Therefore, since we know that $2.(p-a)!+1 \equiv 0 \bmod p$ we get that $(a-1)!=2 \bmod p$. For a prime $p$ chosen large enough we get that $a-1=2$ and so $f(X)=X-3$ for all $X$.
08.05.2016 23:46
anantmudgal09 wrote: it is heavily misplaced for a BMO 3 (no offence to the author, I enjoyed the problem) and it would be better off for a BMO 1. I totally agree with you, I send it as an easy problem
14.05.2016 13:57
02.07.2016 00:17
Can i ask you how do you get that $(b-1)! \equiv \pm 2\pmod{p}$ ? I know wilson's theorem but can't get this
02.07.2016 00:29
godfjock wrote: Can i ask you how do you get that $(b-1)! \equiv \pm 2\pmod{p}$ ? I know wilson's theorem but can't get this In my solution, I forgot to write $p$ instead of $x$ in $2(\boxed{x}-b)! \equiv -1 \pmod{p}$. I've edited now.
09.08.2016 17:55
Seems like my idea is similar to many of the above posts, but can someone check that my solution is correct (and without mistakes)? This problem isn't the easiest to write in a rigorous way.
30.01.2017 09:47
mxzhang wrote: Seems like my idea is similar to many of the above posts, but can someone check that my solution is correct (and without mistakes)? This problem isn't the easiest to write in a rigorous way.
Your solution is ok it seems. However, you are wrong when you say this problem is not easy to write in a rigorous way. Moreover, some people who said this was too easy made some error in calculation (which is in fact, not trivial). They took this problem too lightly just when they saw that $f(p)<p$ must hold and the term with maximum degree has coefficient $1$. Yet, no one except you actually proved that $f(p)>p$ indeed is true for large enough $p$ when $\deg(f)>1$. And if this is considered trivial, a lot of claims in olympiad problems could be considered trivial as well. Therefore, if I was in the solution checking committee, I would have deducted marks from anyone who did not prove this claim (I am not author of this problem or something, just someone who is used to being on an olympiad committee). Moreover some solutions do not actually show the step of getting to $(-1)^kk!\equiv2\pmod p$, which takes non-trivial calculation as well (and you see the irony when someone says it's easy or trivial but makes mistakes right at this step, makes you wonder). Some notes. 1. You really did not have to use big O just to make sense that $d\not\geq2$. You could simply use this: \begin{align*} a_{d-1}x^{d-1}+\cdots+a_1x+a_0 & \leq \dfrac{x^d-1}{x-1}\\ & < a\dfrac{x^d}{a}\\ & = x^d \end{align*}where $a=\max(|a_{d-1}|,\cdots,|a_0|)$. 2. After you reached $(-1)^{c-1}(c-1)!\equiv2\pmod p$, you could just do this $p|(-1)^kk!-2$ so we must have $(-1)^kk!=2$ for large enough $p$ which gives us $k=2$ without any case checking or extra calculation. Bottom line is, this problem is not as trivial as some people have indicated here. The idea is easy to grasp, however, not so trivial silouan wrote: This problem was proposed by Greece Panagiotis Lolas and me (Silouanos Brazitikos) This is a nice problem with good ideas and elementary solution (without using big O).
16.07.2019 19:33
Note that limf(p)=+oo so if degf>1 then limf(p)/p=+oo absurd hence f(x)=x-k. Note that 2(p-k)!=-1[p] for infinite p so (k-1)!=-2[p] if k is even absurd hence k odd so (k-1)!=2 so k=3
11.09.2020 15:22
Cute problem. The only solution is $f(x) = x-3$. If $f(p) \geq p$, then $p$ divides $f(p)!$. Hence $f(p) < p$ for all sufficiently large $p$. Immediately, it follows that $f$ is linear, hence $f(x) = x - n$. We can guarantee that $n$ is positive or else $f(p) > p$. Thus the divisibility holds if and only if \[ f(p)! = (p-n)! \equiv \frac{(p-1)!}{(p-1)(p-2) \cdots (p-(n-1))} \equiv (-1)^{n-1} \frac{(p-1)!}{1 \cdot 2 \cdots (n-1)} \equiv\frac{(-1)^n}{(n-1)!} \pmod{p}\]with the final step coming from Wilson's. Thus \[ (n-1)!(-1)^n \equiv -2 \pmod{p} \]for all sufficiently large primes $p$. Hence either $(n-1)! - 2 = 0$ or $(n-1)! + 2=0$. The latter is obviously absurd, so $n = 3$. Substituting $n=3$ back into the equivalence, it is clear that it works.
27.11.2020 19:24
Nice and Cute. Might be similar to above solutions but who cares? Solution. We claim that only solution is $f(x)=x-3$. Notice that this works since \begin{align*} 2f(p)!+1 &= 2(p-3)!+1 \\ &\equiv 2(-3)(-4)\ldots(-(p-1))+1 \pmod {p} \\ &\equiv (-1)^{p-3}(p-1)!+1 \equiv -1+1 \equiv 0 \pmod{p} \\ \end{align*}Now we show that this is the only solution. Let $P$ denote the given assertion. We startoff with the following claim. Claim. We have $p>f(p)$ for all $p$ prime. Proof. Assume the opposite. Let $\exists p_0$ such that $p_0 \le f(p_0)$ then $p_0\mid f(p_0)!$ whence we get $p_0 \mid 1$ via $P$. Contradiction. Therefore, $p > f(p)\forall~p$ prime. $\square$ Consequently, using the fact that $f$ is monic and above claim. We deduce that $f$ is linear and is of the form $f(x)=x-c$ where $c>0$. It's worth mentioning that $c \neq 1,$ so $c \ge 2$. Since it's well known that $(p-1)!\equiv -1 \pmod{p},$ combining this with $P,$ we get \begin{align*} \implies 2f(p)!-(p-1)! &\equiv 0 \pmod{p} \\ \implies 2(p-c)!-(p-1)! &\equiv 0 \pmod{p} \\ \implies (p-c)! \left[2-\frac{(p-1)!}{(p-c)!}\right] &\equiv 0 \pmod{p} \\ \implies [2-(p-1)(p-2)\ldots (p-(c-2))(p-(c-1))] &\equiv 0 \pmod{p} \\ \implies (-1)^{c-1}(c-1)! &\equiv 2\pmod{p} \\ \end{align*}Consequently, $p \mid (-1)^{c-1} - 2$ for all $p$. Since right hand side is fixed, taking $p$ large enough we get $(-1)^{c-1}(c-1)!=2$ which implies, finally $c=3$. Therefore, $f(x)=x-3$ is our only solution as desired. $\blacksquare$
27.11.2020 20:38
Balkan MO 2016 P3 wrote: Find all monic polynomials $f$ with integer coefficients satisfying the following condition: there exists a positive integer $N$ such that $p$ divides $2(f(p)!)+1$ for every prime $p>N$ for which $f(p)$ is a positive integer. Note: A monic polynomial has a leading coefficient equal to 1. (Greece - Panagiotis Lolas and Silouanos Brazitikos) Obviously, $f$ cannot be constant. Suppose that $\deg f \geq 2$. Then, $\lim_{x \rightarrow +\infty} (f(x)-x)=+\infty$, hence $f(x)>x$ for all large enough $x$. Therefore $f(p)>p$ for all large primes $p$ as well. Then, for each such large prime $p$, we have $2f(p)!+1 \equiv 1 \pmod p$, a conradiction. Therefore, $\deg f=1$, that is $f$ is of the form $x+c$ with $c$ constant. If $c \geq 0$ then $f(p) \geq p$ for all primes $p$, hence $2(f(p)!)+1 \equiv 1 \pmod p$, absurd. Hence, $f \equiv x-c$ with $c>0$. Then, $p \mid 2(p-c)!+1$ for all large enough $p$. By Wilson's, $(p-1)! \equiv -1 \pmod p$, hence $$2(p-1)! \equiv -2 \pmod p \Rightarrow 2(p-c)!(p-c+1) \cdots (p-1) \equiv -2 \pmod p \Rightarrow (p-c+1) \cdots (p-1) \equiv 2 \pmod p \Rightarrow (-c+1)(-c+2) \cdots (-1) \equiv 2 \pmod p$$for all large enough $p$, therefore $(-c+1)(-c+2) \cdots (-1)=2$, which easily implies that $c=3$. To conclude, $f \equiv x-3$ is our only solution.
28.11.2020 02:42
Nice problem The only solution to this problem is $f(x)=x-3$ We start off by stating a well known lemma: Lemma: Let $p$ be a prime number greater than 3, then we have that $(p-3)! \equiv \frac{p-1}{2}\;\;(\text{mod} \; \; p)$ Proof: By Wilsons' theorem we have that $(p-1)\equiv -1 \;\;(\text{mod} \; \; p)$, but since we have that $(p-1)!=(p-1)(p-2)(p-3)!$,we have that: $$(p-1)(p-2)(p-3)! \equiv -1\;\;(\text{mod} \; \; p)$$$$2.(p-3)!\equiv -1 \;\;(\text{mod} \; \; p)$$Since we have that $p > 5$, we have that $(p-3)! \equiv \frac{p-1}{2}\;\;(\text{mod} \; \; p)$. $\blacksquare$ Now back to the problem. If $deg(f) \geq 2$, we have that for some prime number $k$ we are going to have that $f(k) > k$, this implies that $2f(k)!+1 \equiv 1\;\;(\text{mod} \; \; p)$. This implies that $deg(f)=1$, thus this means that $f(x)=x-t$. Now we have that the divisibility condition is equivalent to the following: $$f(p)! \equiv \frac{p-1}{2}\;\;(\text{mod} \; \; p)$$this implies that $f(x)=x-3$, by our lemma.
01.03.2021 02:43
Eray wrote: Find all monic polynomials $f$ with integer coefficients satisfying the following condition: there exists a positive integer $N$ such that $p$ divides $2(f(p)!)+1$ for every prime $p>N$ for which $f(p)$ is a positive integer. Note: A monic polynomial has a leading coefficient equal to 1. (Greece - Panagiotis Lolas and Silouanos Brazitikos) We see that for all sufficiently large enough primes, $f(p) < p$ or else $2f(p)! + 1 \equiv 1 \pmod{p}$ which is a contradiction. This means that $f$ must be linear. Let $f(x) = ax + b$. We see that since $f(p) < p$ and $f(p)$ is always a positive integer, we have that $a = 0$ or $a = 1$ where the previous is cancelled out due to size issues. So $f(x) = x - b$ where I replaced $+b$ by $-b$ because $f(x) < x$. Now, $2(p-b)! \equiv -1 \pmod{p}$ and so using Extended Wilson's Theorem we have that $(b-1)! \equiv 2 \pmod{p}$, choosing $p > (b-1)!$ we must have that $b-1 = 2$ or $b = 3$ as desired giving $f(x) = x+3$
22.08.2021 15:52
Nice and easy First note that for the given condition to hold we must have $f(p) <p$ for large $p$ which is only possible if $f$ is linear. Now let $f(p)=p-k$ for some natural $k$. We see that $$2(p-k)! \equiv(p-1)! \pmod{p} \implies \frac{(p-1)!}{(p-k)!} \equiv{2} \pmod{p}$$since $(p,(p-k)!)=1$. Therefore, $$(p-k+1) \times \dots \times (p-1) \equiv (-1)^{k-1}(k-1)! \equiv{2} \pmod{p}$$Now depending on the parity of $k$, we either have $(k-1)! \equiv{2} \pmod{p}$, or $(k-1)! \equiv{2} \pmod{p}$. Therefore $$(k-1)! \equiv \pm 2 \pmod{p_1p_2 \dots p_t}$$for an arbitrarily large number $t$. Now, clearly $(k-1)!=xy \pm 2$, where $y$ is the product of an arbitrarily large number of primes (and hence arbitrarily large), while $x$ is a whole number. Now for size reasons, $x=0$, since otherwise $(k-1)!$ becomes arbitrarily large. Now of course $(k-1)! =2$, so we get $k=3$. Therefore, $$\boxed{f(x)=x-3}$$is the only solution which works too $\blacksquare$
06.08.2023 11:15
The answer is $f(x)=x-3$ only. Let $f$ be a polynomial satisfying the condition. Claim 1: $f$ must be linear. Proof. Suppose ftsoc that $\deg(f)>1$. As $f$ is monic, if $n\to\infty$ then $f(n)\to\infty$, so $f$ is eventually positive. For the same reason $f(n)-n$ is eventually positive, so $f(n)>n$ eventually. But then for all suficiently large primes $p$, $p\mid 2f(p!)$, so $p\nmid 2f(p!)+1$, a contradiction. Now write $f(n)=n-a$. Note that if $a\le 0$, then $f(p)>p$, giving a contradiction as in the claim. Hence $a>0$. Therefore, we desire $p\mid 2(p-a)!+1$or $2(p-a)!\equiv -1\mod p$. Note that by Wilsons's theorem, \[-1\equiv (p-1)!\equiv (p-1)(p-2)(p-3)!\equiv 2(p-3)!\mod p\]so $a=3$ works. Indeed, $f(x)=x-3$ is a solution. It is quick to check that $a=1,2$ dont work. Claim 2: $a=3$ is the only constant that works. Proof. Assume that $a>3$ is a constant that works. Then, we must have $2(p-a)!\equiv -1\mod p$ for all primes. This implies that \begin{align*} 0&\equiv 2(p-3)!-2(p-a)!\equiv2(p-a)!\left((p-3)(p-4)\ldots(p-(a-1))-1\right)\\ &\equiv (-1)^a\frac12\cdot (a-1)!-1\mod p\iff\\ 2&\equiv (-1)^a(a-1)! \mod p \end{align*}However, $a$ is independent of $p$, so choosing $p$ large enough gives a contradiction.
12.11.2024 20:41
Since $p | 2(f(p)!+1)$, we have that $f(p)<p$ for infinitely many primes. This implies $g(x)=f(x)-x$ is negative for infinitely many positive $x$. This implies $f(x)$ must be linear as otherwise the function $g(x)$ eventually becomes positive for all sufficiently large values. We take $f(x)=x-c$. This gives us that $2(p-c)! \equiv -1 \equiv (p-1)! (mod \ p)$ or that $(-1)^{c-1}(c-1)! \equiv 2(mod \ p)$ for all sufficiently large primes $p$. However, taking $(c-1)!<p$, we see that this is only possible when $c=3$. Hence the required polynomial is $\boxed{x-3}$.
13.11.2024 19:41
Note that $\gcd(p,f(p)!)=1\implies p>f(p)$, if $p$ gets sufficiently large and if $\text{deg}(f)>1$ then $f(p)>p$, which is not possible so $f$ is linear and monic. Let $f(x)=x-a$ then, \begin{align*} 2f(p)!+1&\equiv 0\pmod{p}\\ 2(p-a)!+1&\equiv0\pmod{p}\\ \frac{2(p-1)!}{(p-1)\cdots(p-(a-1))}+1&\equiv 0\pmod{p}\\ \frac{2(-1)^a}{(a-1)!}+1&\equiv 0\pmod{p}\\ (-1)^{a}(a-1)!+2&\equiv 0 \pmod{p} \end{align*}By Wilson's theorem we also have \begin{align*} 2(p-3)!+1\equiv -(p-2)!+1\equiv 0\pmod{p} \end{align*}for sufficiently large prime $p$ we have $(a-1)!\equiv \pm 2$, but it cannot equal $2$ so $a=3$ and $\boxed{f(x)=x-3}$.
13.11.2024 21:45
OG! Easy one. Clearly, $f(x)$ cannot be a constant polynomial, as then we can easily chose a sufficiently large prime $p>N$ such that $p> 2(f(p)!)+1$ Case1: $deg(f(x)) >1$ This means that $f(x)-x=Q(x)$ is a monic polynomial, Thus there exists a sufficiently large integer $l>N$, such that for $x>l$, $Q(x)>0 \iff f(x)>x$ Now consider a prime $p > l$, the $f(p) >p$ \implies $p|(f(p)!)$. So if $p|2(f(p)!)+1$, this means $p|1$. A contradiction! Case2: $deg(f(x))=1$ Since $f(x)$ is monic we have, $f(x)=x+c$ where $c$ is an integer. Substituting this we get, $2(f(p)!)+1\equiv 0 (modp) \iff 2(p+c)!+1\equiv 0 (modp)$. Note that we must have $c<0$ or else $(p+c)! \equiv 0 (modp)$. Set $c=-k$ for some $k \in N$, where $N$ is the set of natural numbers. now just use the same method as of the above post to get $f(x)=x-3$ as the only solution.
13.11.2024 23:49
Since everyone pretty much posts the same solution here, I will do the same (say, for the sake of memorization).
08.01.2025 14:00
Note that: for sufficiently large primes $p$, $f(p)<p$, else if $f(p) \ge p$, then it forces $p|1$ which is a contradiction. Thus, note that $f$ is linear and let $f(x)=x-a$: which gives: $2(p-a)! \equiv -1 \pmod p$ Due to Wilson's Theorem: $(a-1)! \equiv 2 (-1)^{a-1} \pmod p$. If $a$ is odd: $(a-1)! - 2\equiv 0 \pmod p$. Taking large enough values of $p$: $(a-1)! = 2$ or $a=3$. If $a$ is odd: $(a-1)! + 2\equiv 0 \pmod p$. Taking large enough values of $p$: $(a-1)! = - 2$ which has no solutions. Thus: $\boxed{f(x)=x-3}$ is the only solution.
08.01.2025 14:21
Note that for all $p$ large we have $f(x) \le x$- thus $f(x) = O(x)$, and in particular $f$ is linear. Note now that $f(x) = x-c$ for some $c$. Now, we have $(p-c)! \equiv -\frac 12 \pmod{p}$ $$\implies (p-c+1)(p-c+2) \dots(p-1) \equiv \frac{(p-1)!}{(p-c)!} \equiv 2 \pmod{p} \implies (-1)^{c-1}(c-1)! \equiv 2 \pmod{p}$$for all large primes $p$. Thus this quantity is indeed $2$, yielding $c = 3$. But $f(x) = x-3$ can be seen to work, qed.