Package de.tilman_neumann.jml
Class MoebiusFunction
java.lang.Object
de.tilman_neumann.jml.MoebiusFunction
public class MoebiusFunction
extends java.lang.Object
Implementations of the Moebius function.
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
moebius
public static int moebius(java.math.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(java.lang.String[] args)Tests.- Parameters:
args
- Ignored
-