MathDB
Sequence

Source: AMC 12 2006B, Problem 25

February 17, 2006
algorithmnumber theorygreatest common divisorEulerfunctionEuclidean algorithmrelatively prime

Problem Statement

A sequence a1,a2, a_1, a_2, \ldots of non-negative integers is defined by the rule a_{n \plus{} 2} \equal{} |a_{n \plus{} 1} \minus{} a_n| for n1 n\ge 1. If a_1 \equal{} 999, a_2 < 999, and a_{2006} \equal{} 1, how many different values of a2 a_2 are possible? <spanclass=latexbold>(A)</span>165<spanclass=latexbold>(B)</span>324<spanclass=latexbold>(C)</span>495<spanclass=latexbold>(D)</span>499<spanclass=latexbold>(E)</span>660 <span class='latex-bold'>(A) </span> 165 \qquad <span class='latex-bold'>(B) </span> 324 \qquad <span class='latex-bold'>(C) </span> 495 \qquad <span class='latex-bold'>(D) </span> 499 \qquad <span class='latex-bold'>(E) </span> 660