<s>[INST] Confused about harmonic series and Euler product So Euler argued that
$$1 + \frac{1}{2} + \frac{1}{3} + \frac {1}{4} + \cdots = \frac {2 \cdot 3 \cdot 5 \cdot 7 \cdots} {1 \cdot 2 \cdot 4 \cdot 6 \cdots} $$
which you can rearrange to
$$ \left( \frac {1 \cdot 2 \cdot 4 \cdot 6 \cdots} {2 \cdot 3 \cdot 5 \cdot 7 \cdots} \right) \left( 1 + \frac{1}{2} + \frac{1}{3} + \frac {1}{4} + \cdots \right) = 1$$
which in turn you might write as
$$\prod_{n=1}^\infty \frac{p_n-1}{p_n} \times \sum_{n=1}^\infty \frac{1}{n} = 1.$$
I'm confused about how this works rigorously. How do the primes 'align themselves' with the naturals? For example, is the correct statement something like
$$\prod_{n=1}^z \frac{p_n-1}{p_n} \times \sum_{n=1}^z \frac{1}{n} \to 1 \text{ as } z \to \infty$$
where you're taking the first $z$ primes and the first $z$ naturals, or is it something like
$$\prod_{p \le z}^z \frac{p-1}{p} \times \sum_{n=1}^z \frac{1}{n} \to 1 \text{ as } z \to \infty$$
where you're taking all the primes less than or equal to $z$ and the first $z$ naturals, or is it something else entirely? I tried to get a clue with numerical programming but didn't get very far.
 [/INST] $$\prod_1^r{p_n-1\over p_n}=\prod_1^r\left(1-{1\over p_n}\right)^{-1}=\prod_1^r\left(1+{1\over p_n}+{1\over p_n^2}+\cdots\right)=\sum{1\over m}$$ where the sum is over all $m$ divisible by no primes other than $p_1,\dots,p_n$. Formally, the limit as $r\to\infty$ gives the first displayed equation in the question. Rigorously, it can be shown that $$\prod_1^{\infty}\left(1-{1\over p_n^s}\right)^{-1}=\sum_1^{\infty}{1\over n^s}$$ for $s\gt1$ (or even for real part of $s$ exceeding $1$). 
</s>