4. Equation
$$
|| \cdots|||x|-1|-2| \cdots|-2011|=2011
$$

has $\qquad$ solutions.
4. 4.

The solutions to the equation $||x|-1|=1$ are $x=0$ or $\pm 2$;
The solutions to the equation $|||x|-1|-2|=2$ are $x= \pm 1$ or $\pm 5$;
The solutions to the equation $||||x|-1|-2|-3|=3$ are $x= \pm 3$ or $\pm 9$;
In general, the solutions to the equation
$$
|1 \cdots||| x|-1|-2|\cdots|-n \mid=n(n \geqslant 2)
$$

are
$$
x= \pm \frac{n(n-1)}{2} \text { or } \pm \frac{n(n+3)}{2} \text {. }
$$