1. Let the set $P_{n}=\{1,2, \cdots, n\}\left(n \in \mathbf{Z}_{+}\right)$. Denote $f(n)$ as the number of sets $A$ that satisfy the following conditions:
(1) $A \subseteq P_{n}, \bar{A}=P_{n} \backslash A$;
(2) If $x \in A$, then $2 x \notin A$;
(3) If $x \in \bar{A}$, then $2 x \notin \bar{A}$.
Then $f(2018)=$ $\qquad$
$-1.2^{1009}$
For a geometric sequence with a common ratio of 2, $a, 2a, 2^{2}a, \cdots, 2^{k-1}a\left(a\right.$ is an odd number, $k$ such that $\left.2^{k-1}a \leqslant 2018 < 2^{k}a\right)$, the terms have only two cases:

If $a \in A$, then $2a \in \bar{A}, 2^{2}a \in A, \cdots$ and so on; if $a \in \bar{A}$, then $2a \in A, 2^{2}a \in \bar{A}, \cdots$ and so on.

Since $P_{2018}$ contains 1009 odd numbers, there are 1009 such geometric sequences.
Therefore, $f(2018)=2^{1009}$.