A positive integer $n$ with $n \geq 3$ is called a Nella number if there exists a positive integer $x$ with $x<n$ and there exists a positive integer $m$ such that

- $m$ is not divisible by $x$ or by $x+1$, and
- $m$ is divisible by every other positive integer between 1 and $n$ inclusive.

For example, $n=7$ is a Nella number. How many Nella numbers $n$ are there with $50 \leq n \leq 2017$ ?
(A) 393
(B) 394
(C) 395
(D) 396
(E) 397
We proceed using several steps.

Step 1: Least common multiples

For each positive integer $n \geq 3$ and positive integer $x1$ that is not divisible by $p$.

In this case, $p^{a} of 2 less than $n$ | $x$ | $x+1$ | Prime power? | Nella? |
| :---: | :---: | :---: | :---: | :---: | :---: |
| $50 \leq n \leq 64$ | 32 | 32 | 33 | No $(33=3 \cdot 11)$ | No |
| $65 \leq n \leq 128$ | 64 | 64 | 65 | No $(65=5 \cdot 13)$ | No |
| $129 \leq n \leq 256$ | 128 | 128 | 129 | No $(129=3 \cdot 43)$ | No |
| $257 \leq n \leq 512$ | 256 | 256 | 257 | Yes | See below |
| $513 \leq n \leq 1024$ | 512 | 512 | 513 | No $(513=3 \cdot 171)$ | No |
| $1025 \leq n \leq 2017$ | 1024 | 1024 | 1025 | No $(1025=5 \cdot 205)$ | No |

Note that 257 is a prime number since it is not divisible by any prime number less than $\sqrt{257} \approx 16.03$. (These primes are $2,3,5,7,11,13$.)

For each $n$ with $257 \leq n \leq 511, L(n, 256)$ is not divisible by 256 or 257 , so each of these $n$
(there are $511-257+1=255$ of them) is a Nella number.

For $n=512, L(n, 256)$ is divisible by 256 (since 512 is divisible by 256 ), so $n=512$ is not a Nella number as this is the only possible candidate for $x$ in this case.

| Range of $n$ | Largest power  of 2 at most $n$ | $x+1$ | $x$ | Prime power? | Nella? |
| :---: | :---: | :---: | :---: | :---: | :---: |
| $50 \leq n \leq 63$ | 32 | 32 | 31 | Yes | See below |
| $64 \leq n \leq 127$ | 64 | 64 | 63 | No $(63=3 \cdot 21)$ | No |
| $128 \leq n \leq 255$ | 128 | 128 | 127 | Yes | See below |
| $256 \leq n \leq 511$ | 256 | 256 | 255 | No $(255=5 \cdot 51)$ | No |
| $512 \leq n \leq 1023$ | 512 | 512 | 511 | No $(511=7 \cdot 73)$ | No |
| $1024 \leq n \leq 2017$ | 1024 | 1024 | 1023 | No $(1023=3 \cdot 341)$ | No |

Note that 31 and 127 are prime.

For each $n$ with $50 \leq n \leq 61, L(n, 31)$ is not divisible by 31 or 32 , so each of these $n$ (there are $61-50+1=12$ of them) is a Nella number.

For $n=62,63, L(n, 31)$ is divisible by 31 (since 62 is divisible by 31 ), so neither is a Nella number as this is the only possible candidate for $x$ in this case.

For each $n$ with $128 \leq n \leq 253, L(n, 127)$ is not divisible by 127 or 128 , so each of these $n$ (there are $253-128+1=126$ of them) is a Nella number.

For $n=254,255, L(n, 127)$ is divisible by 127 (since 254 is divisible by 127 ), so neither is a Nella number as this is the only possible candidate for $x$ in this case.

Step 8: Final tally

From the work above, there are $255+12+126=393$ Nella numbers $n$ with $50 \leq n \leq 2017$.

ANSWER: (A)