Question E4.2- Probability with Martingales by Williams 
For $s > 1$, define the zeta function as
  $$\zeta(s):= \sum_{n=1}^{\infty} \frac{1}{n^s}.$$
Given a probability space $(\Omega,F,P)$, let $X : \Omega \rightarrow {1,2,3,\ldots}$ and $Y : \Omega \rightarrow {1,2,3,\ldots}$ be two independent random variables such that
$$P(X =n)=P(Y =n)= \frac{n^{-s}}{\zeta(s)} \quad \forall n=1,2,\ldots$$ 
Define $E_p = \left\{\omega \in \Omega: \frac{X(\omega)}{p} \in \{1,2,3,\ldots\}\right\}$, where $p$ is a prime number.
Facts:
  
  
*
  
*{$E_p: p \ge 2 \text{ is prime}$} is an independent family of events, and $P(E_p) = \frac{1}{p^s}$.
  
*$\frac{1}{\zeta(s)} = \prod_{p\ge2 \text{ prime}} \left(1 - \frac{1}{p^s}\right)$.
  
  
  I'd like to prove that, if H is the highest common factor of X and Y, then 
$$P(H = n) = n^{-2s} / \zeta(2s).$$


What I came up with so far is that if $n$ is the h.c.f of X and Y, $np$, for any prime $p$, can not be the common factor of X and Y. In other words
$$\{H = n\} \equiv \left\{ \{E^X_n  \cap E^Y_n\} \cap \left\{\bigcap_{p \ge 2 \text{ prime}}\{E^X_{np}  \cap E^Y_{np}\}^c \right\}\right\},$$
where $E^X_n$ and $E^Y_n$ are the divisibility sets for X and Y respectively, as defined above. 
This equivalence, however does not yield the correct answer. Something is missing and I appreciate any help.
 A: Let $p_n=P(H=n)$ and $q_n=P(n\textrm{ divides }H)$. Then
$$q_n=P(n\textrm{ divides } X\textrm{ and }n\textrm{ divides } Y)
=P(n\textrm{ divides } X)^2
=\left(\sum_{m:n\mid m}\frac{m^{-s}}{\zeta(s)}\right)^2
=\frac{n^{-2s}\zeta(s)^2}{\zeta(s)^2}=n^{-2s}.$$
We can now use Mobius inversion to obtain $p_n$.
$$\sum_{d=1}^\infty\mu(d)q_{nd}=\sum_{d,e=1}^\infty\mu(d)p_{nde}
=\sum_{f=1}^\infty p_{nf}\sum_{d\mid f}\mu(d)=p_n$$
as $\sum_{d\mid f}\mu(d)=0$ for $f\ge2$.
Therefore
$$p_n=\sum_{d=1}^\infty\mu(d)(nd)^{-2s}=n^{-2s}\sum_{d=1}^\infty\mu(d)d^{-2s}
=\frac{n^{-2s}}{\zeta(2s)}.$$
A: $$\newcommand{\N}{\mathbb{N}}$$
Those events are no longer independent, is where the issue comes into play.  Here's one way to look at it:
First note that $$P(X/n = k \, | \, X/n \in \N) = \frac{(nk)^{-s}}{\sum_{j\geq1} (nj)^{-s}} = \frac{k^{-s}}{\zeta(s)}$$
implying that $(X/n \, | \, X/n \in \N)$ has the same law as $X$.  From here, We can compute: \begin{align*}
P(H = n) &= P(X/n \in \N, Y/n \in \N, \text{gcd}(X/n,Y/n) = 1)\\
&=P(X/n \in \N, Y/n \in \N) \cdot P(\text{gcd}(X/n,Y/n) = 1 \, | \,X/n \in \N, Y/n \in \N) \\
&= n^{-s}\cdot n^{-s}\cdot P\left( \text{gcd}(X,Y) = 1 \right)\,.
\end{align*}
Your decomposition gives that this last probability is exactly $1/\zeta(2s)$.
