Bunuel wrote:
TOUGH QUESTION:
A finite sequence of three-digit integers has the property that the tens and units digits of each term are, respectively, the hundreds and tens digits of the next term, and the tens and units digits of the last term are, respectively, the hundreds and tens digits of the first term. For example, such a sequence might begin with the terms 247,
275, and 756 and end with the term 824. Let S be the sum of all the terms in the sequence. What is the largest prime factor that always divides S?
(A) 3
(B) 7
(C) 13
(D) 37
(E) 43
Unless I've misunderstood the question, I think there's a typo that I've highlighted above - if the hundreds and tens digits of one term are the tens and units digits of the previous term, then "275" should be "475".
If you look at any sequence that obeys the given rule, just using letters to represent digits, we must have a sequence that looks something like this:
ABC
BCD
CDE
DEA
EAB
Of course the sequence can be longer or shorter, but the following reasoning would apply to any length of sequence. Notice that each digit that appears as a units digit once must also appear as a tens digit once and as a hundreds digit once. So, moving digits around, adding the five terms above is the same thing as adding these five numbers:
AAA
BBB
CCC
DDD
EEE
and since any number AAA is divisible by 111 = 3*37, this sum will necessarily be divisible by 37.