algorithmnumber theorygreatest common divisorEulerfunctionEuclidean algorithmrelatively prime
Problem Statement
A sequence a1,a2,… of non-negative integers is defined by the rule a_{n \plus{} 2} \equal{} |a_{n \plus{} 1} \minus{} a_n| for n≥1. If a_1 \equal{} 999, a_2 < 999, and a_{2006} \equal{} 1, how many different values of a2 are possible?
<spanclass=′latex−bold′>(A)</span>165<spanclass=′latex−bold′>(B)</span>324<spanclass=′latex−bold′>(C)</span>495<spanclass=′latex−bold′>(D)</span>499<spanclass=′latex−bold′>(E)</span>660