Maths Olympiad Prep

Library / Balkan Mathematical Olympiad competition problems /11 of 16

Balkan Mathematical Olympiad competition problems

Number theory Difficulty 7.7 National Olympiad, round 2 Prove it Balkan Mathematical Olympiad

Find all polynomials P(x)P(x) with integer coefficients such that there exists a positive integer NN such that for all positive integers n>Nn > N we have P(n)>0P(n) > 0 and
n+P(n)∣nP(n)+P(n)n. n + P(n) \mid n^{P(n)} + P(n)^n.

Solution

The solutions are P(n)=1P(n) = 1 and P(n)=2snk−nP(n) = 2^s n^k - n for 0≤s≤30 \le s \le 3 and k≥1k \ge 1, excluding P(n)=0P(n) = 0.

Firstly, we denote Q(n)=P(n)+nQ(n) = P(n) + n. We then have Q(n)>nQ(n) > n for all n>Nn > N. Note that the condition can be rewritten as
nQ(n)−n+(Q(n)−n)n≡0(modQ(n)) n^{Q(n)-n} + (Q(n) - n)^n \equiv 0 \pmod{Q(n)}
nQ(n)−n+(−n)n≡0(modQ(n)) n^{Q(n)-n} + (-n)^n \equiv 0 \pmod{Q(n)}
Let Q(0)=a0Q(0) = a_0. Assume for the sake of contradiction that a0≠0a_0 \neq 0 and let n>Nn > N be an odd positive integer such that (a0,n)=1(a_0, n) = 1. Notice that (Q(n),n)=1(Q(n), n) = 1, since if some prime pp divides both nn and Q(n)Q(n), it would also divide a0a_0, contradiction. Therefore we have
nn(nQ(n)−2n−1)≡0(modQ(n))  ⟹  nQ(n)−2n−1≡0(modQ(n)), n^n(n^{Q(n)-2n} - 1) \equiv 0 \pmod{Q(n)} \implies n^{Q(n)-2n} - 1 \equiv 0 \pmod{Q(n)},
that is
nQ(n)−2n≡1(modQ(n))(1) n^{Q(n)-2n} \equiv 1 \pmod{Q(n)} \quad (1)
Let p∣Q(n)p \mid Q(n) be an odd prime (we know that pp doesn't divide nn). It follows that ordp(n)∣Q(n)−2n\text{ord}_p(n) \mid Q(n) - 2n. Let n0>Nn_0 > N be any odd integer. By the Chinese remainder theorem there exists an integer m>Nm > N such that
m≡n(modp) m \equiv n \pmod{p}
m≡n0(modp−1). m \equiv n_0 \pmod{p-1}.
Therefore, p∣Q(m)p \mid Q(m). Since n0n_0 is odd and p∤np \nmid n, it follows that mm is odd and p∤mp \nmid m. Therefore we can conclude that (in a similar fashion as we have done for nn):
mQ(m)−2m≡1(modp), m^{Q(m)-2m} \equiv 1 \pmod{p},
implying ordp(m)∣Q(m)−2m\text{ord}_p(m) \mid Q(m) - 2m. Since m≡n(modp)m \equiv n \pmod{p} and m≡n0(modp−1)m \equiv n_0 \pmod{p-1}, it follows that ordp(n)∣Q(n0)−2n0\text{ord}_p(n) \mid Q(n_0) - 2n_0.
Therefore
ordp(n)∣Q(m)−2m, \text{ord}_p(n) \mid Q(m) - 2m,
for all odd m>Mm > M, but due to the periodicity of the polynomial QQ modulo ordp(n)\text{ord}_p(n), this in fact means that the above holds for any odd integer mm. Now we have that
ordp(n)∣gcd(Q(1)−2,Q(3)−6,…,Q(2i+1)−2(2i+1),… ). \text{ord}_p(n) \mid \text{gcd}(Q(1) - 2, Q(3) - 6, \dots, Q(2i + 1) - 2(2i + 1), \dots).
Denote the previous gcd with GG. Let p∣Gp \mid G be an odd prime. It follows that p∣Q(p)−2pp \mid Q(p) - 2p, implying p∣a0p \mid a_0. Let kk be a large enough positive integer. Then vp(Q(a0k)−2a0k)=vp(a0)v_p(Q(a_0^k) - 2a_0^k) = v_p(a_0). Therefore vp(G)≤vp(a0)v_p(G) \le v_p(a_0) and so it follows that G∣2ta0G \mid 2^t a_0 for some integer t≥0t \ge 0.
Coming back to our original nn we get that
nG≡1(modp). n^G \equiv 1 \pmod{p}.

From (1) and Lifting The Exponent lemma it follows that
vp(nQ(n)−2n−1)=vp((nG)Q(n)−2nG−1)=vp(nG−1)+vp(Q(n)−2nG)≥vp(Q(n)). v_p(n^{Q(n)-2n}-1) = v_p((n^G)^{\frac{Q(n)-2n}{G}} - 1) = v_p(n^G - 1) + v_p(\frac{Q(n)-2n}{G}) \ge v_p(Q(n)).
As p∣Q(n)p \mid Q(n) and p∤np \nmid n, we get vp(Q(n)−2nG)=0v_p(\frac{Q(n)-2n}{G}) = 0.
If 2∣Q(n)2 \mid Q(n) Lifting The Exponent lemma for p=2p = 2 yields v2(nQ(n)−2n−1)=v2(n2−1)+v2(Q(n)−2n)−1≥v2(Q(n))v_2(n^{Q(n)-2n}-1) = v_2(n^2-1)+v_2(Q(n)-2n)-1 \ge v_2(Q(n)). If 4∣Q(n)4 \mid Q(n), it follows that 2∤Q(n)−2n2 \nmid Q(n)-2n, yielding v2(n2−1)≥v2(Q(n))v_2(n^2-1) \ge v_2(Q(n)). If 2∤Q(n)2 \nmid Q(n), v2(n2−1)≥v2(Q(n))v_2(n^2-1) \ge v_2(Q(n)) still holds.
If 2∣Q(n)2 \mid Q(n), it follows that 2∣G2 \mid G, and we get vp(nG−1)≥vp(Q(n))v_p(n^G - 1) \ge v_p(Q(n)) for all primes p∣Q(n)p \mid Q(n), implying Q(n)∣nG−1Q(n) \mid n^G - 1 (2).
As GG is independent of nn, we get
Q(n)∣nG−1(2) Q(n) \mid n^G - 1 \qquad (2)
for every odd integer n>Nn > N such that (a0,n)=1(a_0, n) = 1.
We say that a polynomial with integer coefficients is primitive if the greatest common divisor of its coefficients is 1.
Lemma. Let P(x),Q(x)∈Z[x]P(x), Q(x) \in \mathbb{Z}[x] be primitive such that Q(n)∣P(n)Q(n) \mid P(n) for infinitely many positive integers nn. Then there exists a polynomial F(x)∈Z[x]F(x) \in \mathbb{Z}[x] such that P(x)=Q(x)F(x)P(x) = Q(x)F(x).
Proof. By the polynomial division algorithm there exist polynomials F(x),R(x)∈Q[x]F(x), R(x) \in \mathbb{Q}[x] such that P(x)=Q(x)F(x)+R(x)P(x) = Q(x)F(x) + R(x) and deg⁡(R(x))<deg⁡(Q(x))\deg(R(x)) < \deg(Q(x)). Dividing the expression by Q(x)Q(x) yields
P(x)Q(x)=F(x)+R(x)Q(x). \frac{P(x)}{Q(x)} = F(x) + \frac{R(x)}{Q(x)}.
Let n1,n2,…n_1, n_2, \dots be a sequence of positive integers such that Q(ni)∣P(ni)Q(n_i) \mid P(n_i) and let P(ni)=diQ(ni)P(n_i) = d_iQ(n_i) for di∈Zd_i \in \mathbb{Z}, for all i∈Ni \in \mathbb{N}. Let DD be the least common multiple of the denominators of the coefficients of F(x)F(x). Then we can write F(ni)=fiDF(n_i) = \frac{f_i}{D} and R(ni)Q(ni)=ri\frac{R(n_i)}{Q(n_i)} = r_i for fi∈Z,ri∈Qf_i \in \mathbb{Z}, r_i \in \mathbb{Q}. We get the following equation for every ii:
di=fiD+ridiD−fiD=ri. d_i = \frac{f_i}{D} + r_i \\ \frac{d_i D - f_i}{D} = r_i.
As lim⁡i→∞ri=0\lim_{i \to \infty} r_i = 0, there has to exist a large enough positive integer jj such that 0<∣rj∣<1D0 < |r_j| < \frac{1}{D}. Therefore R(x)≡0R(x) \equiv 0 and P(x)=Q(x)F(x)P(x) = Q(x)F(x). We are left to prove that FF has integer coefficients.
Let aa be the greatest common divisor of the numerators of the coefficients of F(x)F(x) and let bb be the least common multiple of the denominators of the coefficients of F(x)F(x). We can assume (a,b)=1(a, b) = 1. Therefore F(x)=abF1(x)F(x) = \frac{a}{b}F_1(x) for some primitive polynomial F1(x)∈Z[x]F_1(x) \in \mathbb{Z}[x]. Now we get baP(x)=Q(x)F1(x)\frac{b}{a}P(x) = Q(x)F_1(x). Since baP(x)\frac{b}{a}P(x) is a polynomial with integer coefficients and (a,b)=1(a, b) = 1, it follows that aa divides all coefficients of P(x)P(x). Therefore a=1a = 1 (since PP is primitive).
As Q(x)Q(x) and F1(x)F_1(x) are primitive, bP(x)bP(x) is primitive by Gauss' lemma. Therefore b=1b = 1 and F(x)∈Z[x]F(x) \in \mathbb{Z}[x], as desired. □\square
Let Q(x)=dQ1(x)Q(x) = dQ_1(x), where dd is a positive integer (possibly d=1d = 1) and Q1(x)∈Z[x]Q_1(x) \in \mathbb{Z}[x] is primitive. Assume there exists an odd prime p∣dp \mid d and let k≡1(modp)k \equiv 1 \pmod{p} be an even integer such that

k>Nk > N. Then kQ(k)−k+(−k)k≡2(modp)k^{Q(k)-k} + (-k)^k \equiv 2 \pmod{p}, so p=2p = 2, which is a contradiction. Therefore d=2ld = 2^l for some integer l≥0l \ge 0.
Let P1(x)=xG−1P_1(x) = x^G - 1. Since Q1(n)∣P1(n)Q_1(n) | P_1(n) for infinitely many positive integers nn and P1(x),Q1(x)P_1(x), Q_1(x) are primitive, by the above lemma there exists a polynomial F(x)∈Z[x]F(x) \in \mathbb{Z}[x] such that P1(x)=Q1(x)F(x)P_1(x) = Q_1(x)F(x). In particular, −1=P1(0)=Q1(0)F(0)-1 = P_1(0) = Q_1(0)F(0), so Q1(0)Q_1(0) is either 1 or −1-1. Therefore a0a_0 is either 2l2^l or −2l-2^l.
Let n>Nn > N be an even positive integer. If p∣Q(n)p \mid Q(n) and p∣np \mid n, it follows that p=2p = 2. Additionally, v2(Q(n))=v2(d)=lv_2(Q(n)) = v_2(d) = l. The original condition yields
2l(nQ(n)−2n+1)≡0(modQ(n)) 2^l(n^{Q(n)-2n} + 1) \equiv 0 \pmod{Q(n)}
nQ(n)−2n≡−1(modQ1(n)) n^{Q(n)-2n} \equiv -1 \pmod{Q_1(n)}
n2(Q(n)−2n)≡1(modQ1(n)) n^{2(Q(n)-2n)} \equiv 1 \pmod{Q_1(n)}
Let p∣Q1(n)p \mid Q_1(n) be an odd prime (p∤np \nmid n). Picking n0n_0 divisible by p−1p-1 such that n0≡n(modp)n_0 \equiv n \pmod{p} yields
na0≡−1(modp). n^{a_0} \equiv -1 \pmod{p}.
If a0<0a_0 < 0, i.e. a0=−∣a0∣a_0 = -|a_0|, then
n∣a0∣+1=n−a0+1=na0+1na0≡0(modp) n^{|a_0|} + 1 = n^{-a_0} + 1 = \frac{n^{a_0} + 1}{n^{a_0}} \equiv 0 \pmod{p}
In either case we have
n∣a0∣≡−1(modp) n^{|a_0|} \equiv -1 \pmod{p}
n2l≡−1(modp). n^{2^l} \equiv -1 \pmod{p}.
Therefore ordp(n)=2l+1\text{ord}_p(n) = 2^{l+1}. Using Lifting The Exponent lemma analogously as before (without the case p=2p = 2 as 2∤Q1(n)2 \nmid Q_1(n)), we get:
vp(n2(Q(n)−2n)−1)=vp((n2l+1)2(Q(n)−2n)2l+1−1)=vp(n2l+1−1)+vp(2(Q(n)−2n)2l+1). v_p(n^{2(Q(n)-2n)} - 1) = v_p((n^{2^{l+1}})^{\frac{2(Q(n)-2n)}{2^{l+1}}} - 1) = v_p(n^{2^{l+1}} - 1) + v_p(\frac{2(Q(n)-2n)}{2^{l+1}}).
Since vp(2(Q(n)−2n)2l+1)=0v_p(\frac{2(Q(n)-2n)}{2^{l+1}}) = 0 (because p∣Q1(n)p \mid Q_1(n) so p∣Q(n)p \mid Q(n) and p∤np \nmid n), we get that vp(n2(Q(n)−2n)−1)=vp(n2l+1−1)≥vp(Q1(n))v_p(n^{2(Q(n)-2n)} - 1) = v_p(n^{2^{l+1}} - 1) \ge v_p(Q_1(n)) and so:
n2l+1≡1(modQ1(n)) n^{2^{l+1}} \equiv 1 \pmod{Q_1(n)}
(n2−1)(n2+1)≡0(modQ1(n)) (n^2 - 1)(n^2 + 1) \equiv 0 \pmod{Q_1(n)}
n2l≡−1(modQ1(n)), n^{2^l} \equiv -1 \pmod{Q_1(n)},
where the last equation holds because (n2−1,Q1(n))=1(n^2 - 1, Q_1(n)) = 1 (since any prime pp that divides Q1(n)Q_1(n) also divides n2+1n^2 + 1, and pp is odd).
Thus Q1(n)∣n2+1Q_1(n) \mid n^2 + 1 for all even positive integers n>Nn > N. As Q1(x)Q_1(x) and x2+1x^2 + 1 are primitive, by the lemma there exists a polynomial F1(x)∈Z[x]F_1(x) \in \mathbb{Z}[x] such that x2+1=Q1(x)F1(x)x^2 + 1 = Q_1(x)F_1(x). Since x2+1x^2 + 1 is known to be irreducible and Q1(x)Q_1(x) is eventually positive, it must hold that Q1(x)=x2+1Q_1(x) = x^2 + 1.
We return to odd values of nn once again. If l≥1l \ge 1, we obtain G=2G = 2 (it is immediate for l>1l > 1 and for l=1l = 1 it follows from G∣Q1(1)G \mid Q_1(1)).
Let n>Nn > N be an odd positive integer. Divisibility (2) yields
n2≡1(mod2ln2l+2l), n^2 \equiv 1 \pmod{2^l n^{2^l} + 2^l},

Therefore l=0l = 0 and Q(x)=x+1Q(x) = x + 1, which is easily seen to be a solution to the problem (it gives P(x)=1P(x) = 1).
Now assume a0=0a_0 = 0. Let Q(x)=xR(x)Q(x) = xR(x) for some R(x)∈Z[x]R(x) \in \mathbb{Z}[x]. The original condition after cancelling nn rewrites as
R(n)∣nn−1(nnR(n)−2n+(−1)n). R(n) \mid n^{n-1}(n^{nR(n)}-2n + (-1)^n).
Assume there exists an even integer n>Nn > N and a prime p∣R(n)p \mid R(n) such that p∤np \nmid n. Then p∣nnR(n)−2n+1p \mid n^{nR(n)-2n} + 1. Let n0>Nn_0 > N be an even integer such that p−1∣n0p-1 \mid n_0 and n0≡n(modp)n_0 \equiv n \pmod{p}. It follows that p∣n0n0R(n0)−2n0+1p \mid n_0^{n_0R(n_0)-2n_0} + 1 implying p∣2p \mid 2, which is false since nn is even. (3)
Let R(x)=xk−1G(x)R(x) = x^{k-1}G(x) for some G(x)∈Z[x]G(x) \in \mathbb{Z}[x] such that G(0)≠0G(0) \neq 0 and k≥1k \ge 1. If G(x)G(x) is non-constant, by Schur's theorem there are infinitely many primes pp dividing G(2mp)G(2m_p) for some mp∈Nm_p \in \mathbb{N}. For large enough such primes pp (and thus also 2mp2m_p), we have p∤G(0)p \nmid G(0) and thus p∤2mpp \nmid 2m_p, which is impossible by (3).
Therefore G(x)≡cG(x) \equiv c for some constant cc. It follows from (3) and eventual positivity of Q(x)Q(x) that c=2sc = 2^s for some integer s≥0s \ge 0, that is Q(x)=2s⋅xkQ(x) = 2^s \cdot x^k.
We have
nQ(n)−n+(−n)n≡0(mod2snk). n^{Q(n)-n} + (-n)^n \equiv 0 \pmod{2^s n^k}.
However, if s≥4s \ge 4, let n≡3(mod16)n \equiv 3 \pmod{16} then, Q(n)−n≡5(mod8)Q(n) - n \equiv 5 \pmod{8},
35+(−3)3≡8(mod16), 3^5 + (-3)^3 \equiv 8 \pmod{16},
which is a contradiction. Therefore, s≤3s \le 3.
We will show that all pairs (s,k)(s, k) with 3≥s≥03 \ge s \ge 0 and k≥1k \ge 1 except for s=0,k=1s = 0, k = 1 satisfy the problem's conditions (s=0s = 0 and k=1k = 1 fails since we need to have Q(n)>nQ(n) > n for n>Nn > N).
If nn is even, 2snk∣nn−12^s n^k \mid n^{n-1} for large enough positive integers nn.
If nn is odd, nk∣nn−1n^k \mid n^{n-1} for large enough positive integers nn and it remains to prove that 2s∣n2snk−2n−12^s \mid n^{2^s n^{k-2n}} - 1. For s=0s = 0 the divisibility is obvious and for s≥1s \ge 1 we have that n2snk−2n=n2(2s−1nk−n)≡1(mod8)n^{2^s n^{k-2n}} = n^{2(2^{s-1}n^k-n)} \equiv 1 \pmod{8}, implying the claim.
Finally, Q(n)>nQ(n) > n is obviously satisfied for all such s,ks, k and the result follows.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.