Maths Olympiad Prep

Library / Iranian Mathematical Olympiad /231 of 270

Iranian Mathematical Olympiad

Number theory Difficulty 7.3 National Olympiad, round 2 Prove it Iran

{an}n≥0\{a_n\}_{n \ge 0} and {bn}n≥0\{b_n\}_{n \ge 0} are two sequences of positive integers that ai,bi∈{0,1,2,…,9}a_i, b_i \in \{0, 1, 2, \dots, 9\}. There is an integer number MM such that an,bn≠0a_n, b_n \ne 0 for all n≥Mn \ge M and for each n≥0n \ge 0
(an⋯a1a0‾)2+999∣(bn⋯b1b0‾)2+999 (\overline{a_n \cdots a_1 a_0})^2 + 999 \mid (\overline{b_n \cdots b_1 b_0})^2 + 999

(Note that (xnxn−1…x0‾)=10n×xn+⋯+10×x1+x0(\overline{x_n x_{n-1} \dots x_0}) = 10^n \times x_n + \dots + 10 \times x_1 + x_0.)

prove that an=bna_n = b_n for n≥0n \ge 0.

Solution

Define
An:=an…a1a0‾,Bn:=bn…b1b0‾,Kn:=Bn2+999An2+999. A_n := \overline{a_n \dots a_1 a_0}, \quad B_n := \overline{b_n \dots b_1 b_0}, \quad K_n := \frac{B_n^2 + 999}{A_n^2 + 999}.
Claim 1. {Kn}\{K_n\} is eventually constant or 10n∣An−12+99910^n \mid A_{n-1}^2 + 999 for each positive integer nn.

---

Proof. For each n≥1n \ge 1
Bn2+999=Kn(An2+999),Bn−12+999=Kn−1(An−12+999)(1) B_n^2 + 999 = K_n (A_n^2 + 999), \quad B_{n-1}^2 + 999 = K_{n-1} (A_{n-1}^2 + 999) \quad (1)
From the Definition of An,BnA_n, B_n we know that
An≡An−1(mod10n),Bn≡Bn−1(mod10n)(2) A_n \equiv A_{n-1} \pmod{10^n}, \quad B_n \equiv B_{n-1} \pmod{10^n} \quad (2)
Then (1),(2) imply that
Kn(An2+999)≡Kn−1(An−12+999)(mod10n).(3) K_n (A_n^2 + 999) \equiv K_{n-1} (A_{n-1}^2 + 999) \pmod{10^n}. \quad (3)
If there exist N≥1N \ge 1 such that 10N∤AN−12+99910^N \nmid A_{N-1}^2 + 999, then there is a prime number p∈{2,5}p \in \{2, 5\} such that pN∤AN−12+999p^N \nmid A_{N-1}^2 + 999. (2) infers that An≡AN−1(modpN)A_n \equiv A_{N-1} \pmod{p^N} for each n≥N−1n \ge N-1. So pN∤An2+999p^N \nmid A_n^2 + 999, meaning
vp(An2+999)≤N, v_p (A_n^2 + 999) \le N,
where vp(x)v_p(x) is the power of pp in prime factorization of xx.
Define dn:=gcd⁡(10n,An−12+999)d_n := \gcd(10^n, A_{n-1}^2 + 999). If n≥N+1n \ge N+1 then dn∤10npn−Nd_n \nmid \frac{10^n}{p^{n-N}} because vp(An2+999)≤Nv_p(A_n^2 + 999) \le N. According to (3) there is Kn≡Kn−1(mod10ndn)K_n \equiv K_{n-1} \pmod{\frac{10^n}{d_n}} so
Kn≡Kn−1(modpn−N),(4) K_n \equiv K_{n-1} \pmod{p^{n-N}}, \quad (4)
if n≥Mn \ge M is large enough such that pn−N>100p^{n-N} > 100 then for each i≥n−1i \ge n-1
Ai≥10i  ⟹  Ai2+999≥102i+999Bi<10i+1  ⟹  Bi2+999<102i+2+999. A_i \ge 10^i \implies A_i^2 + 999 \ge 10^{2i} + 999 \\ B_i < 10^{i+1} \implies B_i^2 + 999 < 10^{2i+2} + 999.
Then
Ki=Bi2+999Ai2+999<100<pn−N K_i = \frac{B_i^2 + 999}{A_i^2 + 999} < 100 < p^{n-N}
Hence (4) implies that Kn−1=KnK_{n-1} = K_n for large enough values of nn so the claim is done. □\square

As discussed above there are two cases:
1. 10n∣An−12+99910^n \mid A_{n-1}^2 + 999 for each n≥1n \ge 1.
2. {Kn}\{K_n\} is eventually constant.

Claim 2. *By assumption of the first case, an=bna_n = b_n for all non-negative integers nn.*

---

Proof. Let n≥1n \ge 1 be any positive integer.
An2+999∣Bn2+999  ⟹  10n∣Bn−12+999 A_n^2 + 999 \mid B_n^2 + 999 \implies 10^n \mid B_{n-1}^2 + 999
With above assertions and some calculation it's deduced that a0=b0,a1=b1a_0 = b_0, a_1 = b_1. Note that An=10nan+An−1A_n = 10^n a_n + A_{n-1} so
An2+999≡2×10nanAn−1+An−12+999(mod10n+1). A_n^2 + 999 \equiv 2 \times 10^n a_n A_{n-1} + A_{n-1}^2 + 999 \pmod{10^{n+1}}.
Clearly, 2×10n∣10n+1∣An2+9992 \times 10^n \mid 10^{n+1} \mid A_n^2 + 999 thus
2×10n∣An−12+999∣Bn−12+999(5) 2 \times 10^n \mid A_{n-1}^2 + 999 \mid B_{n-1}^2 + 999 \quad (5)
Which is stronger than assumed relation at beginning of the claim. The remaining part of proof is by using induction. Assume that am=bma_m = b_m for all 0≤m≤n−10 \le m \le n - 1. Which means An−1=Bn−1A_{n-1} = B_{n-1}. Using (5) implies for all n≥1n \ge 1
An2+999≡0(mod2×10n+1)  ⟹  (10nan+An−1)2+999≡0(mod2×10n+1). \begin{align*} A_n^2 + 999 &\equiv 0 \pmod{2 \times 10^{n+1}} \\ \implies (10^n a_n + A_{n-1})^2 + 999 &\equiv 0 \pmod{2 \times 10^{n+1}}. \end{align*}
Which implies
anAn−1+An−12+9992×10n≡0(mod10).(6) a_n A_{n-1} + \frac{A_{n-1}^2 + 999}{2 \times 10^n} \equiv 0 \pmod{10}. \quad (6)
Repeating above discussion with Bn2+999B_n^2 + 999 infers that
bnBn−1+Bn−12+9992×10n≡0(mod10).(7) b_n B_{n-1} + \frac{B_{n-1}^2 + 999}{2 \times 10^n} \equiv 0 \pmod{10}. \quad (7)
According to (6), (7) and the assertion of An−1=Bn−1A_{n-1} = B_{n-1} (induction) it's known that anAn−1≡bnAn−1(mod10)a_n A_{n-1} \equiv b_n A_{n-1} \pmod{10}. Moreover gcd⁡(An,10)=1\gcd(A_n, 10) = 1 since 10n+1∣An2+99910^{n+1} \mid A_n^2 + 999. This implies an≡bn(mod10)a_n \equiv b_n \pmod{10}. Hence an=bna_n = b_n since 0≤an,bn≤90 \le a_n, b_n \le 9. Claim is proved. □\square

The only remaining part of solution is the case that {Kn}\{K_n\} is eventually constant. Suppose that there exist positive integers K,TK, T such that Kn=KK_n = K for all n≥Tn \ge T. Suppose that n≥Tn \ge T then
Bn2+999=K(An2+999)An=10nan+An−1Bn=10nbn+Bn−1}  ⟹  10nbn2+2×bnBn−1=K(10nan2+2×anAn−1)  ⟹  10n(bn2−Kan2)=2(KanAn−1−bnBn−1). \left. \begin{array}{l} B_n^2 + 999 = K(A_n^2 + 999) \\ A_n = 10^n a_n + A_{n-1} \\ B_n = 10^n b_n + B_{n-1} \end{array} \right\} \\ \implies 10^n b_n^2 + 2 \times b_n B_{n-1} = K (10^n a_n^2 + 2 \times a_n A_{n-1}) \\ \implies 10^n (b_n^2 - K a_n^2) = 2 (K a_n A_{n-1} - b_n B_{n-1}).
So
10nAn−1(bn2−Kan2)=2(Kan−bnBn−1An−1).(8) \frac{10^n}{A_{n-1}} (b_n^2 - K a_n^2) = 2 \left( K a_n - b_n \frac{B_{n-1}}{A_{n-1}} \right). \quad (8)
It's known that An,Bn≥10nA_n, B_n \ge 10^n for large enough integers nn
  ⟹  An2≃An2+999,Bn2≃Bn2+999. \implies A_n^2 \simeq A_n^2 + 999, \quad B_n^2 \simeq B_n^2 + 999.
Which implies
Bn2≃KAn2  ⟹  lim⁡n→∞BnAn=K. B_n^2 \simeq K A_n^2 \implies \lim_{n \to \infty} \frac{B_n}{A_n} = \sqrt{K}.
Define
Cn:=BnAn−K  ⟹  lim⁡n→∞Cn=0, C_n := \frac{B_n}{A_n} - \sqrt{K} \implies \lim_{n \to \infty} C_n = 0,
according to (8)
10nAn−1(bn2−Kan2)=2(Kan−bnK)−2bnCn  ⟹  10nAn−1(bn−Kan)(bn+Kan)=2K(Kan−bn)−2bnCn  ⟹  (bn−Kan)(10nAn−1(bn+Kan)+2K)=−2bnCn(9) \begin{aligned} \frac{10^n}{A_{n-1}} (b_n^2 - K a_n^2) &= 2 (K a_n - b_n \sqrt{K}) - 2 b_n C_n \\ \implies \frac{10^n}{A_{n-1}} (b_n - \sqrt{K} a_n) (b_n + \sqrt{K} a_n) &= 2 \sqrt{K} (\sqrt{K} a_n - b_n) - 2 b_n C_n \\ \implies (b_n - \sqrt{K} a_n) \left( \frac{10^n}{A_{n-1}} (b_n + \sqrt{K} a_n) + 2 \sqrt{K} \right) &= -2 b_n C_n \end{aligned} \quad (9)
Right Hand Side of (9) converges to 0 since lim⁡n→∞Cn=0\lim_{n \to \infty} C_n = 0 and 0≤bn≤90 \le b_n \le 9. Also the second parenthesis in (9) is always greater than 2K2\sqrt{K}. So
lim⁡n→∞bn−Kan=0 \lim_{n \to \infty} b_n - \sqrt{K} a_n = 0
But bn−Kanb_n - \sqrt{K}a_n has finite values which infers that there exist positive integer L≥ML \ge M such that bn=Kanb_n = \sqrt{K}a_n for all n≥Ln \ge L. Therefore according to (9) there must be −2bnCn=0-2b_nC_n = 0 for all n≥Ln \ge L. Which implies Cn=0C_n = 0 since bn≠0b_n \ne 0 for n≥Mn \ge M. Therefore
Cn=0  ⟹  Bn=KAn C_n = 0 \implies B_n = \sqrt{K} A_n
In addition with Bn2+999=K(An2+999)B_n^2 + 999 = K(A_n^2 + 999) it's easy to see that 999K=999999K = 999 which means K=1K = 1. So for large enough positive numbers nn,
Bn=An  ⟹  bn⋯b1b0‾=an⋯a1a0‾ B_n = A_n \implies \overline{b_n \cdots b_1 b_0} = \overline{a_n \cdots a_1 a_0}
Therefore ak=bka_k = b_k for all k≥0k \ge 0 and we're done! ■

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.