Skip to main content

2006 AMC 12B Problem 25

Problem 25 of 25HarderNumber TheoryCounting & Probability

A sequence a1,a_1, a2,a_2, \ldots of non-negative integers is defined by the rule an+2=an+1ana_{n+2} = |a_{n+1} - a_n| for n1.n \ge 1. If a1=999,a_1 = 999, a2<999,a_2 \lt 999, and a2006=1,a_{2006} = 1, how many different values of a2a_2 are possible?

Answer choices

Show solution

Solution

The rule gives anan+3(mod2),a_n \equiv a_{n+3} \pmod 2, so a2a_2 has the same parity as a2006=1;a_{2006} = 1; thus a2a_2 is odd. Every term is a multiple of gcd(a1,a2),\gcd(a_1, a_2), and a2006=1a_{2006} = 1 forces gcd(999,a2)=1.\gcd(999, a_2) = 1. Since 999=3337,999 = 3^3 \cdot 37, we need a2a_2 not divisible by 33 or 37.37. Among the odd integers in [1,998][1, 998] there are 499;499; removing the 166166 multiples of 33 and 1313 multiples of 37,37, then adding back the 44 multiples of 111,111, leaves 49916613+4=324.499 - 166 - 13 + 4 = 324. Each such a2a_2 works. For consecutive positive terms u,v,u,v, the update (u,v)(v,vu)(u,v)\mapsto(v,|v-u|) reduces their maximum within at most two steps. Since both initial terms are at most 999,999, some aN=0a_N=0 occurs by N1999.N\le1999. The gcd of each consecutive pair is invariant, so the equal terms immediately before that zero both equal gcd(999,a2)=1.\gcd(999,a_2)=1. The sequence then cycles through 1,1,0.1,1,0. Finally, 20062(mod3),2006\equiv2\pmod3, so a2006a_{2006} has the same odd parity as a2;a_2; in this cycle it must therefore be 1.1. Thus, the correct answer is B.

More practice

Concepts: greatest common divisor · parity · inclusion-exclusion

Problem text and solution from the LIVE past-contest archive. See also the AoPS wiki page for community solutions.