# Difference between revisions of "2020 AMC 10A Problems/Problem 22"

## Problem

For how many positive integers $n \le 1000$ is$$\left\lfloor \dfrac{998}{n} \right\rfloor+\left\lfloor \dfrac{999}{n} \right\rfloor+\left\lfloor \dfrac{1000}{n}\right \rfloor$$not divisible by $3$? (Recall that $\lfloor x \rfloor$ is the greatest integer less than or equal to $x$.)

$\textbf{(A) } 22 \qquad\textbf{(B) } 23 \qquad\textbf{(C) } 24 \qquad\textbf{(D) } 25 \qquad\textbf{(E) } 26$

## Solution (Casework)

Expression: $$\left\lfloor \dfrac{998}{n} \right\rfloor+\left\lfloor \dfrac{999}{n} \right\rfloor+\left\lfloor \dfrac{1000}{n}\right \rfloor$$

Solution:

Let $a = \left\lfloor \frac{998}n \right\rfloor$

Since $\frac{1000}n - \frac{998}n = \frac{2}n$, for any integer $n \geq 2$, the difference between the largest and smallest terms before the $\lfloor x \rfloor$ function is applied is less than or equal to $1$, and thus the terms must have a range of $1$ or less after the function is applied.

This means that for every integer $n \geq 2$,

$\bullet$ if $\frac{1000}n$ is an integer, then the three terms in the expression above must be $(a, a, a + 1)$,

$\bullet$ if $\frac{999}n$ is an integer, then the three terms in the expression above must be $(a, a + 1, a + 1)$,

$\bullet$ if $\frac{998}n$ is an integer and $n \neq 2$ (since if $n = 2$, $\frac{1000}n$ will be an integer, and it will be $1$ greater than $\frac{998}n$), then the three terms in the expression above must be $(a, a, a)$, and

$\bullet$ if none of $\{\frac{998}n, \frac{999}n, \frac{1000}n\}$ are integral, then the three terms in the expression above must be $(a, a, a)$.

The last statement is true because in order for the terms to be different, there must be some integer in the interval $(\frac{998}n, \frac{999}n)$ or the interval $(\frac{999}n, \frac{1000}n)$. However, this means that multiplying the integer by $n$ should produce a new integer between $998$ and $999$ or $999$ and $1000$, exclusive, but because no such integers exist, the original integer cannot exist, and thus, the terms must be equal.

Note that $n = 1$ does not work; to prove this, we just have to substitute $1$ for $n$ in the expression. This gives us $\left\lfloor \dfrac{998}{1} \right\rfloor+\left\lfloor \dfrac{999}{1} \right\rfloor+\left\lfloor \dfrac{1000}{1}\right \rfloor = 998 + 999 + 1000 = 2997 = 999 \cdot 3$ which is divisible by 3.

Now, we test the four cases listed above.

Case 1: $n$ divides $998$

As mentioned above, the three terms in the expression are $(a, a, a)$, so the sum is $3a$, which is divisible by $3$. Therefore, the first case does not work.

Case 2: $n$ divides $999$

Because $n$ divides $999$, the number of possibilities for $n$ is the same as the number of factors of $999$.

$999$ = $3^3 \cdot 37^1$. So, the total number of factors of $999$ is $4 \cdot 2 = 8$.

However, we have to subtract $1$, because the case $n = 1$ does not work, as mentioned previously. This leaves $8 - 1 = 7$ cases.

Case 3: $n$ divides $1000$

Because $n$ divides $1000$, the number of possibilities for $n$ is the same as the number of factors of $1000$.

$1000$ = $5^3 \cdot 2^3$. So, the total number of factors of $1000$ is $4 \cdot 4 = 16$.

Again, we have to subtract $1$, so this leaves $16 - 1 = 15$ cases.

Case 4: $n$ divides none of $\{998, 999, 1000\}$

As in Case 1, the value of the terms of the expression are $(a, a, a)$. The sum is $3a$, which is divisible by 3, so this case does not work.

Now that we have counted all of the cases, we add them.

$0 + 7 + 15 + 0 = 22$, so the answer is $\boxed{\textbf{(A)}22}$.