メルテンスの定理
∑ p ≤ n 1 p = S ( n ) log  n + ∫ 2 n S ( t ) t log 2  t d t = 1 + R ( n ) log  n + ∫ 2 n d t t log  t + ∫ 2 n R ( t ) d t t log 2  t = log  log  n + 1 − log  log  2 + R ( n ) log  n + ∫ 2 ∞ R ( t ) d t t log 2  t − ∫ n ∞ R ( t ) d t t log 2  t = log  log  n + 1 − log  log  2 + ∫ 2 ∞ R ( t ) d t t log 2  t + R ( n ) log  n + O ( ∫ n ∞ d t t log 2  t ) = log  log  n + 1 − log  log  2 + ∫ 2 ∞ R ( t ) d t t log 2  t + O ( 1 log  n ) {\displaystyle {\begin{aligned}\sum _{p\leq n}{\frac {1}{p}}&={\frac {S(n)}{\log n}}+\int _{2}^{n}{\frac {S(t)}{t\log ^{2}t}}dt\\&=1+{\frac {R(n)}{\log n}}+\int _{2}^{n}{\frac {dt}{t\log t}}+\int _{2}^{n}{\frac {R(t)dt}{t\log ^{2}t}}\\&=\log \log n+1-\log \log 2+{\frac {R(n)}{\log n}}+\int _{2}^{\infty }{\frac {R(t)dt}{t\log ^{2}t}}-\int _{n}^{\infty }{\frac {R(t)dt}{t\log ^{2}t}}\\&=\log \log n+1-\log \log 2+\int _{2}^{\infty }{\frac {R(t)dt}{t\log ^{2}t}}+{\frac {R(n)}{\log n}}+O\left(\int _{n}^{\infty }{\frac {dt}{t\log ^{2}t}}\right)\\&=\log \log n+1-\log \log 2+\int _{2}^{\infty }{\frac {R(t)dt}{t\log ^{2}t}}+O\left({\frac {1}{\log n}}\right)\end{aligned}}}