Pairs with common factors: Difference between revisions

Content added Content deleted
(Add Maxima implementation)
(fix jump anchor problem)
Line 701: Line 701:


=={{header|Maxima}}==
=={{header|Maxima}}==
{{trans|Mathematica}}
{{trans|Mathematica_/_Wolfram_Language}}
<syntaxhighlight lang="Maxima">/* Define the prime counting function (pcf) */
<syntaxhighlight lang="Maxima">/* Define the prime counting function (pcf) */
pcf(n) := n*(n - 1)/2 + 1 - sum(totient(i), i, 1, n);
pcf(n) := n*(n - 1)/2 + 1 - sum(totient(i), i, 1, n);