For how many numbers $n$ does $2017$ divided by $n$ have a remainder of either $1$ or $2$?
To solve the problem, we need to determine how many numbers \( n \) satisfy the condition that \( 2017 \) divided by \( n \) has a remainder of either \( 1 \) or \( 2 \).

1. **Case 1: Remainder is 1**

   If \( 2017 \) divided by \( n \) has a remainder of \( 1 \), then:
   \[
   2017 \equiv 1 \pmod{n}
   \]
   This implies:
   \[
   2017 - 1 \equiv 0 \pmod{n} \implies 2016 \equiv 0 \pmod{n}
   \]
   Therefore, \( n \) must be a divisor of \( 2016 \). We need to find the number of divisors of \( 2016 \).

   The prime factorization of \( 2016 \) is:
   \[
   2016 = 2^5 \cdot 3^2 \cdot 7
   \]
   The number of divisors of a number \( n = p_1^{e_1} \cdot p_2^{e_2} \cdots p_k^{e_k} \) is given by:
   \[
   (e_1 + 1)(e_2 + 1) \cdots (e_k + 1)
   \]
   For \( 2016 \):
   \[
   (5+1)(2+1)(1+1) = 6 \cdot 3 \cdot 2 = 36
   \]
   So, there are \( 36 \) divisors of \( 2016 \).

2. **Case 2: Remainder is 2**

   If \( 2017 \) divided by \( n \) has a remainder of \( 2 \), then:
   \[
   2017 \equiv 2 \pmod{n}
   \]
   This implies:
   \[
   2017 - 2 \equiv 0 \pmod{n} \implies 2015 \equiv 0 \pmod{n}
   \]
   Therefore, \( n \) must be a divisor of \( 2015 \). We need to find the number of divisors of \( 2015 \).

   The prime factorization of \( 2015 \) is:
   \[
   2015 = 5 \cdot 13 \cdot 31
   \]
   The number of divisors of \( 2015 \) is:
   \[
   (1+1)(1+1)(1+1) = 2 \cdot 2 \cdot 2 = 8
   \]
   So, there are \( 8 \) divisors of \( 2015 \).

3. **Combining the Results**

   We have \( 36 \) divisors from the first case and \( 8 \) divisors from the second case. However, we need to check if there is any overlap between the divisors of \( 2016 \) and \( 2015 \).

   The only common divisor between \( 2016 \) and \( 2015 \) is \( 1 \), since \( 2016 \) and \( 2015 \) are consecutive integers and thus coprime. Therefore, the number \( 1 \) is counted in both cases.

   To avoid double-counting, we subtract \( 1 \) from the total:
   \[
   36 + 8 - 1 = 43
   \]

The final answer is \(\boxed{43}\).