9. There are $n$ consecutive natural numbers $1,2, \cdots, n$, after removing one of the numbers $x$, the average of the remaining numbers is 16. Then the values of $n$ and $x$ that satisfy the condition are $\qquad$
9. $n=30, x=1$ or $n=31, x=16$ or $n=$ $32, x=32$.
The sum of $n$ consecutive natural numbers is
$$
S_{n}=\frac{n(n+1)}{2} \text {. }
$$

If $x=n$, then the average of the remaining numbers is
$$
\frac{S_{n}-n}{n-1}=\frac{n}{2} \text {; }
$$

If $x=1$, then the average of the remaining numbers is
$$
\frac{S_{n}-1}{n-1}=\frac{n}{2}+1 \text { . }
$$
Thus, $\frac{n}{2} \leqslant 16 \leqslant \frac{n}{2}+1$.
Solving this, we get $30 \leqslant n \leqslant 32$.
When $n=30$, $\frac{n}{2}+1=16$, so $x=1$;
When $n=31$, $30 \times 16=\frac{31 \times(31+1)}{2}-x$,
Solving this, we get $x=16$;
When $n=32$, $\frac{n}{2}=16$, so $x=32$.