pub fn termination_period(n: u64, base: u64) -> Option<u64>Expand description
Determine how 1/n behaves when written in the given base.
Returns:
Some(0)— the expansion terminates (every prime factor ofndividesbase),Some(k)— the expansion repeats with periodk,None— degenerate input (n == 0orbase < 2).
The period of the repeating part is the multiplicative order of base
modulo the part of n coprime to base.