Class MoebiusFunction


  • public class MoebiusFunction
    extends Object
    Implementations of the Moebius function.
    Author:
    Tilman Neumann
    • Method Detail

      • moebius

        public static int moebius​(BigInteger n)
        Computes the value of the Moebius function at n. Returns 1 if n=1, (-1)^k, if k is the number of distinct prime factors, 0, if k has repeated prime factors.
        Parameters:
        n - Argument
        Returns:
        moebius(n)
      • main

        public static void main​(String[] args)
        Tests.
        Parameters:
        args - Ignored