Squarefreeness tests.
(new in 0.90.0)
Definition:
n: squarefree <=> there is no p whose square divides n.
Examples:
There are two families of functions in the module. A function in a family "classical" raises an exception when an execution does not reach to the conclusion whether a number is squarefree or not, while a function in another family "ternary" just return None representing undecidable in the same situation.
If return value is True, n is squarefree. Otherwise, the squarefreeness is still unknown and Undetermined is raised.
The condition is so strong that it seems n is a prime or a Carmichael number if this function returns True.
pre-condition: n ought to be odd.
reference: H.W.Lenstra 1973
Test whether n is squarefree or not.
This method do anything but factorization including Lenstra's method.
If the squarefreeness is still unknown,then Undetermined is raised.
Test whether n is squarefree or not.
The method is a kind of trial division and inefficient for large numbers.
Test whether n is squarefree or not.
It is obvious that if one knows the prime factorization of the number, he/she can tell whether the number is squarefree or not.
The third logical value means "uncertain" or "proof unknown". We designate None to this value. It lets "unknown" status be, at least, not true. There are nothing corresponding to boolean logic operators. They are out of scope of this module.
Test the squarefreeness of n. The return value is one of the ternary logical constants. If return value is True, n is squarefree. Otherwise, the squarefreeness is still unknown and None is returned.
The condition is so strong that it seems n is a prime or a Carmichael number if this function returns True.
pre-condition: n ought to be odd.
reference: H.W.Lenstra 1973
This is a ternary-version of lenstra.
Test the squarefreeness of n. The return value is one of the ternary logical constants.
The method uses a series of trivial tests including lenstra_ternary.
This is a ternary-version of trivial_test.
Test the squarefreeness of n. The return value is one of the True or False, not None.
The method is a kind of trial division.
This is a ternary-version of trial_division.
Just for symmetry, viafactor_ternary is defined as an alias of viafactory.
The method uses partial factorization into squarefree parts, if such partial factorization is possible. In other cases, it completely factor n by trial division.
THIS IS AN EXPERIMENTAL IMPLEMENTATION.
Undetermined state of calculation used by "classical" family.