# 2020 AMC 10A Problems/Problem 24

## Problem

Let $n$ be the least positive integer greater than $1000$ for which

$$\gcd(63, n+120) =21\quad \text{and} \quad \gcd(n+63, 120)=60.$$

What is the sum of the digits of $n$?

$\textbf{(A) } 12 \qquad\textbf{(B) } 15 \qquad\textbf{(C) } 18 \qquad\textbf{(D) } 21\qquad\textbf{(E) } 24$

## Solution 1

We know that $\gcd(n+57,63)=21$ and $\gcd(n-57, 120)= 60$ by the Euclidean Algorithm. Hence, let $n+57=21\alpha$ and $n-57=60 \gamma$, where $\gcd(\alpha,3)=1$ and $\gcd(\gamma,2)=1$. Subtracting the two equations, $38=7\alpha-20\gamma$. Letting $\gamma = 2s+1$, we get $58=7\alpha-40s$. Taking modulo $40$, we have $\alpha \equiv{14} \pmod{40}$. We are given that $n=21\alpha -57 >1000$, so $\alpha \geq 51$. Notice that if $\alpha =54$ then the condition $\gcd(\alpha,3)=1$ is violated. The next possible value of $\alpha = 94$ satisfies the given condition, giving us $n=1917$.

Alternatively, we could have said $\alpha = 40k+14 \equiv{0} \pmod{3}$ for $k \equiv{1} \pmod{3}$ only, so $k \equiv{0,2} \pmod{3}$, giving us our answer. Since the problem asks for the sum of the digits of $n$, our answer is $1+9+1+7=\boxed{\textbf{(C) } 18}$.

~Prabh1512

## Solution 2

The conditions of the problem reduce to the following: $n+120 = 21k$ and $n+63 = 60\ell$, where $\gcd(k,3) = 1$ and $\gcd(\ell,2) = 1$. From these equations, we see that $21k - 60\ell = 57$. Solving this Diophantine equation gives us that $k = 20a + 17$ and $\ell = 7a + 5$. Since, $n>1000$, we can do some bounding and get that $k > 53$ and $\ell > 17$. Now we start bashing by plugging in numbers that satisfy these conditions: $a=4$ is the first number that works so we get $\ell = 33$, $k = 97$. Therefore, we have $n=21(97)-120=60(33)-63=1917$, and our answer is $1+9+1+7=\boxed{\textbf{(C) } 18}$.

## Solution 3

We first find that $n\equiv6\pmod{21}$ and $n\equiv57\pmod{60}$, then we get $n=21x+6$ and $n=60y+57$ by definitions, where $x$ and $y$ are integers. It follows that $y$ must be odd, since the GCD will be $120$ instead of $60$ if $y$ is even. Also, the unit digit of $n$ must be $7$, since the unit digit of $60y$ is always $0$ and the unit digit of $57$ is $7$. Therefore, we find that $x$ must end in $1$ to satisfy $n$ having a unit digit of $7$. Also, we find that $x$ must not be a multiple of $3$ or else the GCD will be $63$. Therefore, we test values for $x$ and find that $x=91$ satisfies all these conditions. Therefore, $n=1917$ and $1+9+1+7 = \boxed{\textbf{(C) } 18}$.

~happykeeper

## Solution 4

We are given that $\gcd(63, n+120) =21$ and $\gcd(n+63, 120)=60.$ By applying the Euclidean algorithm in reverse, we have $$\gcd(63, n+120) = \gcd(63, n+120 + 63) = \gcd(63, n+183) = 21$$ and $$\gcd(n+63, 120) = \gcd(n+63 + 120, 120) = \gcd(n+183, 120) = 60.$$

We now know that $n+183$ must be divisible by $21$ and $60,$ so it is divisible by $\text{lcm}(21, 60) = 420.$ Therefore, $n+183 = 420k$ for some integer $k.$ We know that $3 \nmid k,$ or else the first condition won't hold ($\gcd$ will be $63$) and $2 \nmid k,$ or else the second condition won't hold ($\gcd$ will be $120$). Since $k = 1$ gives us too small of an answer, then $k=5,$ from which $n = 1917.$ So, the answer is $1+9+1+7 = \boxed{\textbf{(C) } 18}.$

## Solution 5

$\gcd(n+63,120)=60$ tells us $n+63\equiv60\pmod {120}$. The smallest $n+63$ that satisfies the previous condition and $n>1000$ is $1140$, so we start from there. If $n+63=1140$, then $n+120=1197$. Because $\gcd(n+120,63)=21$, $n+120\equiv21\pmod {63}$ or $n+120\equiv42\pmod {63}$. We see that $1197\equiv0\pmod {63}$, which does not fulfill the requirement for $n+120$, so we continue by keep on adding $120$ to $1197$, in order to also fulfill the requirement for $n+63$. Soon, we see that $n+120\pmod {63}$ decreases by $6$ every time we add $120$, so we can quickly see that $n=1917$ because at that point $n+120\equiv21\pmod {63}$. We add up all digits of $1917$ to get $\boxed{\textbf{(C) } 18}$.

~SmileKat32

## Solution 6

We are able to set up the following system of congruences: \begin{align*} n &\equiv 6 \pmod {21}, \\ n &\equiv 57 \pmod {60}. \end{align*} Therefore, by definition, we are able to set-up the following system of equations: \begin{align*} n &= 21a + 6, \\ n &= 60b + 57. \end{align*} Thus, we have $21a + 6 = 60b + 57,$ from which $$7a + 2 = 20b + 19.$$ We know $7a \equiv 0 \pmod {7},$ and since $7a = 20b + 17,$ therefore $20b + 17 \equiv 0 \pmod{7}.$ Simplifying this congruence further, we have $$b\equiv 3 \pmod{7}.$$ Thus, by definition, $b = 7x + 3.$ Substituting this back into our original equation, we get $$n = 60(7x + 3) + 57 = 420x + 237.$$ By definition, we are able to set up the following congruence: $$n \equiv 237 \pmod{420}.$$ Thus, $n = 1917$, so our answer is simply $1+9+1+7=\boxed{\textbf{(C) } 18}$.

Remark

Since $n \equiv -120 \pmod{21},$ we conclude that $n \equiv 6 \pmod{21}.$

Since $n \equiv -63 \pmod{60},$ we conclude that $n \equiv 57 \pmod{60}.$

Remember that $b \equiv 3 \pmod{7}.$

Lastly, the reason why $n \neq 1077$ is $n + 120$ would be divisible by $63$, which is not possible due to the certain condition.

~nikenissan ~Midnight

## Solution 7

First, we find $n$. We know that it is greater than $1000$, so we first input $n = 1000$. From the first equation, $\gcd(63, n + 120) = 21$, we know that if $n$ is correct, after we add $120$ to it, it should be divisible by $21$, but not $63$: $$\frac{n + 120}{21} = \frac{1120}{21} = 53\text{ R }7.$$ This does not work. To get to the nearest number divisible by $21$, we have to add $14$ to cancel out the remainder. (Note that we don't subtract $7$ to get to $53$; $n$ is already at its lowest possible value!) Adding $14$ to $1000$ gives us $n = 1014$. (Note: $n$ is currently divisible by 63, but that's fine since we'll be changing it in the next step.)

Now using the second equation, $\gcd(n + 63, 120) = 60$, we know that if $n$ is correct, then $n+63$ is divisible by $60$ but not $120$: $$\frac{n + 63}{60} = \frac{1077}{60} = 17\text{ R }57.$$ Again, this does not work. This requires some guessing and checking. We can add $21$ over and over again until $n$ is valid. This changes $n$ while also maintaining that $\frac{n + 120}{21}$ has no remainders. After adding $21$ once, we get $18 r 18$. By pure luck, adding $21$ two more times gives us $19$ with no remainders. We now have $1077 + 21 + 21 + 21 = 1140$. However, this number is divisible by $120$. To get the next possible number, we add the LCM of $21$ and $60$ (once again, to maintain divisibility), which is $420$. Unfortunately, $1140 + 420 = 1560$ is still divisible by $120$. Adding $420$ again gives us $1980$, which is valid. However, remember that this is equal to $n + 63$, so subtracting $63$ from $1980$ gives us $1917$, which is $n$.

The sum of its digits are $1 + 9 + 1 + 7 = \boxed{\textbf{(C) } 18}$.

~primegn

## Solution 8 (Euclidean Algorithm)

By the Euclidean Algorithm, we have \begin{alignat*}{8} \gcd(63,n+120)&=\hspace{1mm}&&\gcd(63,\phantom{ }\underbrace{n+120-63k_1}_{(n+120) \ \mathrm{mod} \ 63}\phantom{ })&&=21, \\ \gcd(n+63,120)&=&&\gcd(\phantom{ }\underbrace{n+63-120k_2}_{(n+63) \ \mathrm{mod} \ 120}\phantom{ },120)&&=60. \end{alignat*} Clearly, $n+120-63k_1$ must be either $21$ or $42,$ and $n+63-120k_2$ must be $60.$

## Video Solutions

### Video Solution 2

https://youtu.be/8mNMKH0T9W0 - Happytwin

### Video Solution 3 (Quick & Simple)

Education The Study of Everything

### Video Solution 5

https://youtu.be/R220vbM_my8?t=899 ~ amritvignesh0719062.0