Möbius function: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Minor tidy)
(Add PARI/GP implementation)
Line 1,743: Line 1,743:
1 0 -1 0 -1 1 -1 0 0 -1 0 0 -1 -1 0 0 1 1 -1 0
1 0 -1 0 -1 1 -1 0 0 -1 0 0 -1 -1 0 0 1 1 -1 0
-1 -1 1 0 1 -1 1 0 0 -1 -1 0 -1 1 -1 0 -1 0 -1 0</pre>
-1 -1 1 0 1 -1 1 0 0 -1 -1 0 -1 1 -1 0 -1 0 -1 0</pre>


=={{header|PARI/GP}}==
{{trans|Julia}}
<syntaxhighlight lang="PARI/GP">
{
for(i = 1, 99,
print1(moebius(i) " ");
if(i % 10 == 0, print("\n"););
);
}
</syntaxhighlight>
{{out}}
<pre>
1 -1 -1 0 -1 1 -1 0 0 1

-1 0 -1 1 1 0 -1 0 -1 0

1 1 -1 0 0 1 0 0 -1 -1

-1 0 1 1 1 0 -1 1 1 0

-1 -1 -1 0 0 1 -1 0 0 0

1 0 -1 0 1 0 1 1 -1 0

-1 1 0 0 1 -1 -1 0 1 -1

-1 0 -1 1 0 0 1 -1 -1 0

0 1 -1 0 1 1 1 0 -1 0

1 0 1 1 1 0 -1 0 0
</pre>



=={{header|Pascal}}==
=={{header|Pascal}}==