# Difference between revisions of "2017 AMC 12A Problems/Problem 18"

## Problem

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

$\textbf{(A)}\ 1 \qquad\textbf{(B)}\ 3\qquad\textbf{(C)}\ 12\qquad\textbf{(D)}\ 1239\qquad\textbf{(E)}\ 1265$

## Solution

Note that $n\equiv S(n)\bmod 9$, so $S(n+1)-S(n)\equiv n+1-n = 1\bmod 9$. So, since $S(n)=1274\equiv 5\bmod 9$, we have that $S(n+1)\equiv 6\bmod 9$. The only one of the answer choices $\equiv 6\bmod 9$ is $\boxed{(D)=\ 1239}$.

## Solution 2

One possible value of $S(n)$ would be $1275$, but this is not any of the choices. So we know that $n$ ends in $9$, and after adding $1$, the last digit $9$ carries over. If the next digit is also a $9$, this process repeats. By the end, the sum of digits would decrease by $9$ multiplied by the number of carry-overs but increase by 1 as a result of the final carrying over. Therefore, the result must be $9x-1$ away from the original value of $S(n)$, $1274$, where $x$ is a positive integer. The only choice that satisfies this condition is $1239$, since $(1274-1239+1) \bmod 9 = 0$. So the answer is $\boxed{D}$.