AMC 10 Step by Step

2017 AMC 10A Problem 20

P16-20~4 minPrint

Let S(n)S(n) equal the sum of the digits of positive integer nn . For example, S(1507)=13S(1507) = 13 . For a particular positive integer nn , S(n)=1274S(n) = 1274 . Which of the following could be the value of S(n+1)S(n+1) ?

Log in to save your progress.
Show solution without answering

Key insight

Adding 1 raises the digit sum by 1, but each 9 that turns into 0 takes away 9. So the new digit sum is 1275 minus a multiple of 9.

Solution

1. Try small examples. S(23)=5S(23) = 5 and S(24)=6S(24) = 6: adding 11 usually raises the digit sum by 11. But S(199)=19S(199) = 19 and S(200)=2S(200) = 2: the two 99s turned into 00s, each losing 99, and the 11 went up to 22.
2. The general rule. If nn ends in kk nines, adding 11 turns those nines into zeros (losing 99 each) and raises the next digit by 11. So
S(n+1)=S(n)+1−9k=1275−9k.S(n+1) = S(n) + 1 - 9k = 1275 - 9k.
(With k=0k = 0 this is just 12751275.)
3. Test the choices. S(n+1)S(n+1) must equal 12751275 minus a multiple of 99. Subtract each choice from 12751275 and see whether 99 divides the result:

Choice1275−choice1275 - \text{choice}Divisible by 99?
1112741274no (1274=9⋅141+51274 = 9 \cdot 141 + 5)
3312721272no (1272=9⋅141+31272 = 9 \cdot 141 + 3)
121212631263no (1263=9⋅140+31263 = 9 \cdot 140 + 3)
123912393636yes (36=9⋅436 = 9 \cdot 4)
126512651010no
  1. Check that 12391239 really happens. We need nn ending in exactly four nines with digit sum 12741274. Those four nines give 3636, so the other digits must add to 1274−36=12381274 - 36 = 1238. For example, take a 66, then 154154 eights (6+154⋅8=12386 + 154 \cdot 8 = 1238), then 99999999. Adding 11 turns the last eight into a nine and the four nines into zeros, giving digit sum 1238+1=12391238 + 1 = 1239.

The answer is (D) 1239\boxed{\textbf{(D)}\ 1239}.

Why this works

A number and its digit sum always leave the same remainder when divided by 99. Carrying can change a digit sum a lot, but only by multiples of 99. So checking remainders on division by 99 quickly rules out impossible digit sums, a handy tool for any digit-sum question.

Alternative approach

Use remainders on division by 99 directly. The digits of 12751275 add to 1515, and 1515 leaves remainder 66, so S(n+1)S(n+1) must leave remainder 66 when divided by 99. Find each choice's remainder from its digit sum: 1→11 \to 1, 3→33 \to 3, 12→312 \to 3, 1239→15→61239 \to 15 \to 6, 1265→14→51265 \to 14 \to 5. Only 12391239 has remainder 66.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

Suppose nn ends in exactly kk nines (k≥0k \ge 0). Adding 11 turns those kk nines into zeros and increases the next digit by 11, so
S(n+1)=S(n)+1−9k=1275−9k.S(n+1) = S(n) + 1 - 9k = 1275 - 9k.
Hence S(n+1)≡1275(mod9)S(n+1) \equiv 1275 \pmod 9. The digit sum of 12751275 is 1515, so 1275≡6(mod9)1275 \equiv 6 \pmod 9, and S(n+1)S(n+1) must leave remainder 66 when divided by 99.

Check the choices by their own digit sums: 1→11 \to 1; 3→33 \to 3; 12→312 \to 3; 1239→15→61239 \to 15 \to 6; 1265→14→51265 \to 14 \to 5. Only 12391239 is 6(mod9)6 \pmod 9.

It is attainable: 1275−1239=36=9⋅41275 - 1239 = 36 = 9 \cdot 4, so take nn ending in exactly four nines with the remaining digits summing to 1274−36=12381274 - 36 = 1238 (for example 66 followed by 154154 eights, then 99999999). Then S(n+1)=1239S(n+1) = 1239.

The answer is (D) 1239\boxed{\textbf{(D)}\ 1239}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.