A sequence of positive integers is defined by and for each . Find .
Solution
If is the relevant greatest common divisor, then , which implies (by induction) that the sequence is periodic modulo , with period 1000 . In particular, . So must divide . Conversely, we can see that modulo , so (again by induction) the sequence is periodic modulo with period 5 , and hence are indeed both divisible by . So the answer is , which we can compute directly; it is 677.
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.