Package de.tilman_neumann.jml
Class MoebiusFunction
- java.lang.Object
-
- de.tilman_neumann.jml.MoebiusFunction
-
public class MoebiusFunction extends Object
Implementations of the Moebius function.- Author:
- Tilman Neumann
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
Tests.static int
moebius(BigInteger n)
Computes the value of the Moebius function at n.
-
-
-
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
-
-