Maths Olympiad Prep

Library / Benelux Mathematical Olympiad competition problems /5 of 8

Benelux Mathematical Olympiad competition problems

Number theory Difficulty 7.6 National Olympiad, round 2 Prove it Benelux Mathematical Olympiad

Problem:

a) Find all positive integers gg with the following property: for each odd prime number pp there exists a positive integer nn such that pp divides the two integers
gn−n and gn+1−(n+1) g^{n}-n \quad \text{ and } \quad g^{n+1}-(n+1)

b) Find all positive integers gg with the following property: for each odd prime number pp there exists a positive integer nn such that pp divides the two integers
gn−n2 and gn+1−(n+1)2 g^{n}-n^{2} \quad \text{ and } \quad g^{n+1}-(n+1)^{2}

Solution

Solution:

a.
Let gg be a positive integer with the given property. So for each odd prime number pp there exists a positive integer nn such that p∣gn−np \mid g^{n}-n and p∣gn+1−(n+1)p \mid g^{n+1}-(n+1).
If gg has an odd prime factor pp, then from p∣gn−np \mid g^{n}-n it follows that p∣np \mid n, while from p∣gn+1−(n+1)p \mid g^{n+1}-(n+1) we deduce that p∣n+1p \mid n+1. But pp cannot divide both nn and n+1n+1; contradiction. So gg is a power of 22: g=2kg=2^{k} for some k⩾0k \geqslant 0.
If g=20=1g=2^{0}=1, then p∣1−np \mid 1-n and p∣1−(n+1)p \mid 1-(n+1), which is again a contradiction.
Suppose k⩾2k \geqslant 2. Then g−1g-1 has an odd prime factor pp, therefore g≡1(modp)g \equiv 1\pmod{p} so 0≡gn−n≡1−n(modp)0 \equiv g^{n}-n \equiv 1-n\pmod{p} and 0≡gn+1−(n+1)≡1−(n+1)(modp)0 \equiv g^{n+1}-(n+1) \equiv 1-(n+1)\pmod{p}, which is again a contradiction.
Now we prove that g=21=2g=2^{1}=2 does satisfy the condition. Let a prime p>2p>2 be given. Choose n=(p−1)2n=(p-1)^{2}, then we have n≡(−1)2=1(modp)n \equiv(-1)^{2}=1\pmod{p}. By Fermat's little theorem (using gcd⁡(2,p)=1\gcd(2, p)=1) we know that 2p−1≡1(modp)2^{p-1} \equiv 1\pmod{p}, so
2n=2(p−1)2=(2p−1)p−1≡1≡n(p) 2^{n}=2^{(p-1)^{2}}=\left(2^{p-1}\right)^{p-1} \equiv 1 \equiv n \quad(p)
Multiplying both sides by 22, we see that also
2n+1≡2n=n+n≡n+1(p) 2^{n+1} \equiv 2 n=n+n \equiv n+1 \quad(p)
We conclude that only g=2g=2 has the given property.

b.
Let gg be a positive integer with the given property. So for each odd prime number pp there exists a positive integer nn such that p∣gn−n2p \mid g^{n}-n^{2} and p∣gn+1−(n+1)2p \mid g^{n+1}-(n+1)^{2}.
If gg has an odd prime factor pp, then from p∣gn−n2p \mid g^{n}-n^{2} it follows that p∣n2p \mid n^{2}, so also p∣np \mid n, while from p∣gn+1−(n+1)2p \mid g^{n+1}-(n+1)^{2} we deduce that p∣(n+1)2p \mid(n+1)^{2}, so also p∣n+1p \mid n+1.
But pp cannot divide both nn and n+1n+1; contradiction. So gg is a power of 22: g=2kg=2^{k} for some k⩾0k \geqslant 0.
If g=20=1g=2^{0}=1, then for any odd prime pp we have p∣1−n2=(1−n)(1+n)p \mid 1-n^{2}=(1-n)(1+n) and p∣1−(n+1)2=(1−(n+1))(1+(n+1))p \mid 1-(n+1)^{2}=(1-(n+1))(1+(n+1)). Now take p=5p=5. The first statement says that n≡1n \equiv 1 or n≡−1≡4(mod5)n \equiv-1 \equiv 4\pmod{5}, and the second that n≡0n \equiv 0 or n≡−2≡3n \equiv-2 \equiv 3 (mod5)\pmod{5}. But this yields a contradiction.
If g=21=2g=2^{1}=2, then for any odd prime pp we have p∣2n−n2p \mid 2^{n}-n^{2} and p∣2n+1−(n+1)2p \mid 2^{n+1}-(n+1)^{2}. Now take p=3p=3. As 3∤2n3 \nmid 2^{n} and 3∤2n+13 \nmid 2^{n+1}, we know that 3∤n23 \nmid n^{2} and 3∤(n+1)23 \nmid(n+1)^{2}. So these two squares must be 11 modulo 33 (as 22 can never be a square modulo 33). Therefore also 2n2^{n} and 2n+12^{n+1} must be 11 modulo 33, which gives 2⋅1≡2⋅2n=2n+1≡1(mod3)2 \cdot 1 \equiv 2 \cdot 2^{n}=2^{n+1} \equiv 1\pmod{3}; contradiction.
Now suppose k⩾2k \geqslant 2. Then g−1g-1 has an odd prime factor pp, therefore g≡1(modp)g \equiv 1\pmod{p} so 0≡gn−n2≡1−n2=(1−n)(1+n)(modp)0 \equiv g^{n}-n^{2} \equiv 1-n^{2}=(1-n)(1+n)\pmod{p} and 0≡gn+1−(n+1)2≡1−(n+1)2=(1−(n+1))(1+(n+1))(modp)0 \equiv g^{n+1}-(n+1)^{2} \equiv 1-(n+1)^{2}=(1-(n+1))(1+(n+1))\pmod{p}. Suppose p⩾5p \geqslant 5. The first statement says that n≡1n \equiv 1 or n≡−1(modp)n \equiv-1\pmod{p}, and the second that n≡0n \equiv 0 or n≡−2(modp)n \equiv-2\pmod{p}. But nn can only be congruent to at most one of the numbers −2,−1,0-2,-1,0 and 11, since p⩾5p \geqslant 5; contradiction. We conclude that p=3p=3, so g−1g-1 contains only prime factors 33. Hence 2k−1=3ℓ2^{k}-1=3^{\ell} for some ℓ>0\ell>0. We see that 2k−1≡(−1)k−1(mod3)2^{k}-1 \equiv(-1)^{k}-1\pmod{3}, while 3ℓ≡0(mod3)3^{\ell} \equiv 0\pmod{3}. So kk has to be even, say k=2mk=2 m, and our equation becomes 22m−1=3ℓ2^{2 m}-1=3^{\ell}, or equivalently (2m−1)(2m+1)=3ℓ\left(2^{m}-1\right)\left(2^{m}+1\right)=3^{\ell}. Not both factors on the left-hand side can be divisible by 33, so 2m−1=12^{m}-1=1 and 2m+1=3ℓ2^{m}+1=3^{\ell}, so m=1m=1. Hence g=22=4g=2^{2}=4.
Now we show that g=4g=4 does have the given property. For this we use that g=2g=2 is a solution to part (a): for any odd prime pp there exists a positive integer nn such that
n≡2n(modp) and n+1≡2n+1(modp). n \equiv 2^{n} \quad\pmod{p} \quad \text{ and } \quad n+1 \equiv 2^{n+1} \quad\pmod{p} .
Taking the square of both congruences, we obtain
n2≡(2n)2=(22)n=4n(modp) n^{2} \equiv\left(2^{n}\right)^{2}=\left(2^{2}\right)^{n}=4^{n} \quad\pmod{p}
and
(n+1)2≡(2n+1)2=(22)n+1=4n+1(modp) (n+1)^{2} \equiv\left(2^{n+1}\right)^{2}=\left(2^{2}\right)^{n+1}=4^{n+1} \quad\pmod{p}
as desired.
We conclude that only g=4g=4 has the given property.

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.