public class Factors extends TreeMap<BigInteger,Integer>
n = p1e1 + ... + pkek
where p1 < ... < pk are prime numbers and the exponents e1, ..., ek are positive integers. Technically, the prime factors are given as aTreeMap
<BigInteger
, Integer
>
where the keys are the different unique primes and the values the
respective exponents, i.e.,
[<p1, e1>, ..., <pk, ek>]
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Factors(BigInteger n)
Computes prime factors of n and stores them into this map.
|
Factors(long n)
Computes prime factors of n and stores them into this map.
|
Modifier and Type | Method and Description |
---|---|
BigInteger |
lambda()
The Carmichael function λ(n).
|
BigInteger |
phi()
The Euler function φ(n), sometimes also called totient function.
|
String |
toHTMLString()
Returns a HTML string representation of this factor list.
|
String |
toString()
Returns a string representation of this factor list.
|
BigInteger |
value()
Returns the integer value determined by these prime factors.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
equals, hashCode, isEmpty
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove
public Factors(BigInteger n)
n
- the number which is to be factorizedpublic Factors(long n)
n
- the number which is to be factorizedpublic BigInteger lambda()
public BigInteger phi()
public BigInteger value()
public String toHTMLString()
public String toString()
toString
in class AbstractMap<BigInteger,Integer>