Maths Olympiad Prep

Library / CAPS Match /3 of 8

CAPS Match, 2025

Number theory Difficulty 6.4 National Olympiad Prove it Czech-Polish-Slovak Mathematical Match

Let {an}n=1∞\{a_n\}_{n=1}^{\infty} be a sequence of positive integers such that for every positive integer nn
an+1=(n+1)(an−n+1). a_{n+1} = (n + 1)(a_n - n + 1).
In terms of a1a_1, determine the greatest positive integer kk such that gcd⁡(ai,ai+1)=k\gcd(a_i, a_{i+1}) = k
for some positive integer i≥2i \ge 2. (Note that gcd⁡(x,y)\gcd(x, y) denotes the greatest common
divisor of integers xx and yy.)

Solution

First, we will prove by induction that an=(a1−1)n!+na_n = (a_1 - 1)n! + n for all n≥1n \ge 1. The base case a1a_1 is trivial. Now suppose that the closed form holds for some ana_n. Then
an+1=(n+1)(((a1−1)n!+n)−n+1)an+1=(n+1)((a1−1)n!+1)an+1=(a1−1)(n+1)!+(n+1) \begin{align*} a_{n+1} &= (n + 1) (((a_1 - 1)n! + n) - n + 1) \\ a_{n+1} &= (n + 1) ((a_1 - 1)n! + 1) \\ a_{n+1} &= (a_1 - 1)(n + 1)! + (n + 1) \end{align*}
Hence, the proof by induction is complete. For the sake of clarity, let c=a1−1c = a_1 - 1.
Let pp be a prime number dividing gcd⁡(an,an+1)\gcd(a_n, a_{n+1}) for n≥2n \ge 2. Assume p≤np \le n. Then
cn!+n≡n(modp)cn!+n \equiv n \pmod p however, we have c(n+1)!+n+1≡n+1(modp)c(n+1)!+n+1 \equiv n+1 \pmod p thus we conclude
p>np > n. We have an+1=(n+1)(cn!+1)a_{n+1} = (n+1)(cn!+1) so then p∣(n+1)(cn!+1)p \mid (n+1)(cn!+1). Assume pp
divides cn!+1cn!+1. Then cn!+n≡cn!+1(modp)cn!+n \equiv cn!+1 \pmod p, which implies n≡1(modp)n \equiv 1 \pmod p, which is a
contradiction since p>np > n. So either gcd⁡(an,an+1)=1\gcd(a_n, a_{n+1}) = 1 or p=n+1=gcd⁡(an,an+1)p = n+1 = \gcd(a_n, a_{n+1}).
Now suppose p=n+1p = n + 1, notice that in this case p≥3p \ge 3. Then, according to
Wilson's theorem p∣n!+1p \mid n! + 1 so we have p∣n!+1∣cn!+cp \mid n! + 1 \mid cn! + c, which implies p∣cn!+c+n−n  ⟹  p∣c−n  ⟹  p∣c+1p \mid cn! + c + n - n \implies p \mid c - n \implies p \mid c + 1, which is however, equal to a1a_1. The chain of
thoughts is reversible so we obtain gcd⁡(ap−1,ap)=p\gcd(a_{p-1}, a_p) = p if and only if p∣a1p \mid a_1. Therefore,
the answer is that kk is the biggest odd prime divisor of a1a_1 or 1 if a1a_1 is a power of 2.

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.