galois.carmichael

galois.carmichael(n)[source]

Implements the Carmichael function to find the smallest positive integer m such that a^m = 1 (mod n) for 1 <= a < n.

Parameters

n (int) – A positive integer.

Returns

The smallest positive integer m such that a^m = 1 (mod n) for 1 <= a < n.

Return type

int