Meissel–Mertens constant: Difference between revisions
Content added Content deleted
imported>Maxima enthusiast No edit summary |
(→{{header|Perl}}: iterate over primes (much faster)) |
||
Line 714: | Line 714: | ||
{{libheader|ntheory}} |
{{libheader|ntheory}} |
||
<syntaxhighlight lang="perl" line>use v5.36; |
<syntaxhighlight lang="perl" line>use v5.36; |
||
use ntheory |
use ntheory qw(forprimes); |
||
my $s; |
my $s; |
||
forprimes { $s += log(1 - 1/$_)+1/$_ } 1e9; |
|||
say my $result = $s + .57721566490153286;</syntaxhighlight> |
say my $result = $s + .57721566490153286;</syntaxhighlight> |
||
{{out}} |
{{out}} |