Maxima Function
moebius (n)
Represents the Moebius function.
When n is product of k distinct primes,
moebius(n)
simplifies to (-1)^k;
when n = 1, it simplifies to 1;
and it simplifies to 0 for all other positive integers.
moebius
distributes over equations, lists, matrices, and sets.
Examples:
(%i1) moebius (1); (%o1) 1 (%i2) moebius (2 * 3 * 5); (%o2) - 1 (%i3) moebius (11 * 17 * 29 * 31); (%o3) 1 (%i4) moebius (2^32); (%o4) 0 (%i5) moebius (n); (%o5) moebius(n) (%i6) moebius (n = 12); (%o6) moebius(n) = 0 (%i7) moebius ([11, 11 * 13, 11 * 13 * 15]); (%o7) [- 1, 1, 1] (%i8) moebius (matrix ([11, 12], [13, 14])); [ - 1 0 ] (%o8) [ ] [ - 1 1 ] (%i9) moebius ({21, 22, 23, 24}); (%o9) {- 1, 0, 1}