RosettaCodeData/Task/Meissel-Mertens-constant/00-TASK.txt
2023-07-01 13:44:08 -04:00

37 lines
942 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;Task:
Calculate MeisselMertens constant up to a precision your language can handle.
;Motivation:
Analogous to Euler's constant, which is important in determining the sum of reciprocal natural numbers, Meissel-Mertens' constant is important in calculating the sum of reciprocal primes.
;Example:
We consider the finite sum of reciprocal natural numbers:
''1 + 1/2 + 1/3 + 1/4 + 1/5 ... 1/n''
this sum can be well approximated with:
''log(n) + E''
where ''E'' denotes Euler's constant: 0.57721...
''log(n)'' denotes the natural logarithm of ''n''.
Now consider the finite sum of reciprocal primes:
''1/2 + 1/3 + 1/5 + 1/7 + 1/11 ... 1/p''
this sum can be well approximated with:
''log( log(p) ) + M''
where ''M'' denotes Meissel-Mertens constant: 0.26149...
;See:
:*   Details in the Wikipedia article:  [https://en.wikipedia.org/wiki/Meissel%E2%80%93Mertens_constant MeisselMertens constant]
<br /><br />