Probability that two random integers have only one prime factor in common
Solution 1:
Fix $n\ge2$ and fix a finite set of primes $p_1,\dots,p_k$. The probability that $n$ integers "picked at random" have the prime factors $p_1,\dots,p_k$ in common and no other primes is $$ \frac1{(p_1\cdots p_k)^n} \prod_{p\notin\{p_1,\dots,p_k\}} \bigg( 1-\frac1{p^n} \bigg) = \frac1{(p_1^n-1)\cdots(p_k^n-1)\zeta(n)}. $$ This can be proved in the usual way: count the proportion of $n$-tuples $(m_1,\dots,m_n)$ with this property where each $1\le m_j\le M$, and let $M$ go to infinity.
It follows that the probability that $n$ integers "picked at random" have exactly $k$ prime factors in common is $$ \frac1{\zeta(n)} \sum_{p_1<\cdots<p_k} \frac1{(p_1^n-1)\cdots(p_k^n-1)}. $$ For example, when $k=1$, we get $$ \frac1{\zeta(n)} \sum_p \frac1{p^n-1} = \frac1{\zeta(n)} \big( P(n) + P(2n) + P(3n) + \cdots \big). $$ When $k=2$, we get $$ \frac1{\zeta(n)} \frac12 \bigg( \bigg( \sum_p \frac1{p^n-1} \bigg)^2 - \sum_p \frac1{(p^n-1)^2} \bigg). $$