To elaborate on above answer, let $M$ be the set of all sequences $(r_{0}, \ldots, r_{n}, 0,\ldots)$ with $r_{i}$ being rational and $n \in \mathbb{N}$. (This is the set of sequences with finite support and rational entries).
Since $\mathbb{Q}$ is countable and finite product of countable sets is countable and then countable union of countable sets is countable, we see that $M$ is countable.
Now let us see that $M$ is dense in $\ell_{p}(\mathbb{R})$. To do this, given any $x = (x_{n}) \in \ell_{p}(\mathbb{R})$, and for $\epsilon > 0$ we must find an element $y \in M$ such that $d(x,y) <\epsilon$. We have
$$ \sum\limits_{n=0}^{\infty} |x_{n}|^{p} < \infty $$
Hence, given $\epsilon > 0$, there exists $m \in \mathbb{N}$ such that
$$ \sum\limits_{n=m+1}^{\infty} |x_{n}|^{p} < \epsilon/2 $$
Now for $0\leq i \leq m$, choose $r_{i} \in \mathbb{Q}$ such that $|r_{i} - x_{i}| < \left(\frac{\epsilon}{2m}\right)^{\frac{1}{p}}$ (using that the rationals are dense in reals).
Then the element $y = (r_{0}, r_{1}, \ldots, r_{m}, 0, 0, \ldots) \in M$ is the required element.
In the one direction, to construct a compact set with dense span from a countable dense subset, note that if $(x_n)_{n\in\mathbb{N}}$ is a sequence converging to $x_\ast$, then the set $\{ x_n : n \in \mathbb{N}\} \cup \{x_\ast\}$ is compact. Construct a convergent sequence from the countable dense subset without changing the span.
For example, if $D = \{ y_n : n\in\mathbb{N}\}$ is a countable dense subset, set $x_n = \frac{1}{1+(n+1)\lVert y_n\rVert}y_n$ for $n\in\mathbb{N}$. We then have $\lVert x_n\rVert < \frac{1}{n+1}$, so $x_n \to 0$, whence $K = \{0\} \cup \{ x_n : n \in \mathbb{N}\}$ is compact, and since $y_n = (1+(n+1)\lVert y_n\rVert)y_n \in \operatorname{span} K$, it follows that $\overline{\operatorname{span} K} \supset \overline{D} = X$, so $K$ is a compact set with dense span.
In the other direction, note that a compact metric space is separable. Show that if $\operatorname{span} K$ is dense, and $D$ a countable dense subset of $K$, then $\operatorname{span}_{\mathbb{Q}[i]} D$ is also dense.
Namely, since $\mathbb{Q}[i]$ is dense in $\mathbb{C}$, it follows that $\operatorname{span} D \subset \overline{\operatorname{span}_{\mathbb{Q}[i]} D}$, and hence
$$\overline{\operatorname{span}_{\mathbb{Q}[i]} D} = \overline{\operatorname{span} D}$$
is a closed linear subspace containing $\overline{D} = K$, hence $\overline{\operatorname{span} K} = X$. But $\operatorname{span}_{\mathbb{Q}[i]} D$ is countable since $D$ and $\mathbb{Q}[i]$ are, so $X$ is separable.
Best Answer
A solution follows, but I encourage you to think about these hints first:
Let's see that $A$ is dense in $D$. Pick $y \in D$ and $\varepsilon > 0$. By definition of closure, you can take $x \in \langle x_n \rangle_{n \geq 1}$ such that $\|y-x\| < \varepsilon/2$. Now, the element $x$ must be a finite linear combination of terms of this sequence. There must exist then $a_1, \dots, a_n \in \mathbb{R}$ such that
$$ x = a_1x_1 + \cdots a_nx_n. \tag{1} $$
Think about why this is true: surely $x$ is a linear combination of some terms, so you can "fill the gaps" between these by choosing $a_i = 0$ obtaining $(1)$.
Finally, by density of the rationals, pick rationals $q_1,\dots,q_n$ such that $|q_i-a_i|\|x_i\| < \varepsilon/2n$ so that noting $z = \sum_{i=1}^nq_ix_i$ we have
$$ \|x-z\| = \left\|\sum_{i=1}^n(a_i-q_i)x_i\right\| \leq \sum_{i=1}^n|a_i-q_i|\|x_i\| < \varepsilon/2. $$
Therefore $z \in A$ and $\|y-z\| \leq \|y-x\| + \|x-z\| < \varepsilon$.
Now let's show that $\#A_n$ is countable. Recall that if $X$ is countable, so is $X^n$. Finally, note that the assignment
$$ (q_1,\dots,q_n) \in \mathbb{Q}^n \mapsto \sum_{i=1}^nq_ix_i \in A_n $$
is surjective, and so $\aleph_0 = \#\mathbb{Q}^n \geq \#A_n$.