$4 P$ is a natural number. Consider $E=\left\{1,2, \cdots, 2^{p}\right\}$ and its subsets $A$ with the following property: if $x \in A$, then $2 x \bar{\in} A$. Find the maximum number of elements in $A$.

The maximum number of elements in $A$ is $\boxed{2^{p-1}}$.
$$42^{s} \times 1,2^{s} \times 3, \cdots$$ and $$2^{s+1} \times 1,2^{s+1} \times 3, \cdots$$ contain at most $$2^{p-1} \div 2^{s}=2^{p-s-1}$$ elements in $$A(s=0,2, \cdots)$$. Therefore, the number of elements in $$A$$ is
$$
|A| \leqslant\left\{\begin{array}{l}
2^{p-1}+2^{p-3}+\cdots+2^{2}+1, \text { if } p \text { is odd. } \\
2^{p-1}+2^{p-3}+\cdots+2+1, \text { if } p \text { is even. }
\end{array}\right.
$$

That is,
$$
|A| \leqslant\left\{\begin{array}{l}
\frac{1}{3}\left(2^{p+1}-1\right), \text { if } p \text { is odd. } \\
\frac{1}{3}\left(2^{p+1}+1\right), \text { if } p \text { is even. }
\end{array}\right.
$$

If $$p$$ is odd,
$$
\begin{aligned}
A= & \left\{1,3,5, \cdots, 2^{p}-1\right\} \cup\left\{2^{2} \times 1,2^{2} \times 3, \cdots, 2^{2} \times\left(2^{p-2}-1\right)\right\} \\
& \cup \cdots \cup\left\{2^{p-1}\right\},
\end{aligned}
$$

making the equality in (1) hold.
If $$p$$ is even,
$$
\begin{aligned}
A & =\left\{1,3,5, \cdots, 2^{p}-1\right\} \cup\left\{2^{2} \times 1,2^{2} \times 3, \cdots, 2^{2} \times\left(2^{p-2}-1\right)\right\} \\
& \cup \cdots \cup\left\{2^{p}\right\},
\end{aligned}
$$

making the equality in (1) hold. Therefore, the maximum value of $$|A|$$ is
$$
\left\{\begin{array}{l}
\frac{1}{3}\left(2^{p+1}-1\right), \text { if } p \text { is odd. } \\
\frac{1}{3}\left(2^{p+1}+1\right), \text { if } p \text { is even. }
\end{array}\right.
$$