Let $p$ be a rational prime. Consider the topological group $\prod\_{\ell\ne p} {\mathbb Z}\_{\ell} $. Does there exist a natural number $M$ such that $\{p^{n\_1}+p^{n\_2}+\cdots+p^{n\_m}: \text{$0\le m\le M$ and $n\_i\ge 0$
for each $i$}\}$ is a dense subset of $\prod\_{\ell\ne p} {\mathbb Z}\_{\ell}$?


How about the following weaker assertion?


For each $x\in \prod\_{\ell\ne p} {\mathbb Z}\_{\ell}$, there exist a natural number $M\_x$ such that $x$ lies in the closure of $\{e\_1p^{n\_1}+e\_2p^{n\_2}+\cdots+e\_mp^{n\_m}: \text{$0\le m\le M\_x$ and $n\_i\ge 0$ and $e\_i\in\{-1,1\}$ for each $i$}\}$ in $\prod\_{\ell\ne p} {\mathbb Z}\_{\ell}$. 


Can it hold?



Dense subset in a product of $p$-adic groups?
Felipe's idea can be converted into a rigorous proof that there is no such $M$. 


Fix a positive $\epsilon < 1/M$. Suppose $m$ is a large positive integer prime to $p$ with the property that the units group $U(\mathbb{Z}/m\mathbb{Z})$ has an exponent $\lambda$ (say) smaller than $m^{\epsilon}$. Then, modulo $m$, the number of distinct sums of the type you describe is at most $1+\lambda+\lambda^2 + \dots + \lambda^M$, and this is $< m$ (provided $m$ is large enough in terms of $M$ and $\epsilon$). For such an $m$, your set does not cover $\mathbb{Z}/m\mathbb{Z}$ and so your set cannot be dense in $\prod\_{\ell \ne p} \mathbb{Z}\_{\ell}$.


How do we know such an $m$ exists? This is a special case of known results on small values of the Carmichael $\lambda$-function. See, e.g., Lemma 1.2 in this recent note: <http://alpha.math.uga.edu/~pollack/sunit-impan.pdf>


EDITED LATER: This was overkill. We don't need to control the exponent of $U(\mathbb{Z}/m\mathbb{Z})$, just the order of $p$ modulo $m$. And with this change, it's easy to produce the desired $m$: Just take $m = p^k-1$, for a sufficiently large $k$. (Or, as in Felipe's post, $(p^k-1)/(p-1)$.)


