Maths Olympiad Prep

Library / HMMT February /439 of 1302

HMMT February

Algebra Difficulty 5.1 AIME, harder Find the answer

A sequence of positive integers is defined by a0=1a_{0}=1 and an+1=an2+1a_{n+1}=a_{n}^{2}+1 for each n≥0n \geq 0. Find gcd⁡(a999,a2004)\operatorname{gcd}(a_{999}, a_{2004}).

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

If dd is the relevant greatest common divisor, then a1000=a9992+1≡1=a0( mod d)a_{1000}=a_{999}^{2}+1 \equiv 1=a_{0}(\bmod d), which implies (by induction) that the sequence is periodic modulo dd, with period 1000 . In particular, a4≡a2004≡0a_{4} \equiv a_{2004} \equiv 0. So dd must divide a4a_{4}. Conversely, we can see that a5=a42+1≡1=a0a_{5}=a_{4}^{2}+1 \equiv 1=a_{0} modulo a4a_{4}, so (again by induction) the sequence is periodic modulo a4a_{4} with period 5 , and hence a999,a2004a_{999}, a_{2004} are indeed both divisible by a4a_{4}. So the answer is a4a_{4}, which we can compute directly; it is 677.

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: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.