galois.is_square_free

galois.is_square_free(n)

Determines if \(n\) is square-free, such that \(n = p_1 p_2 \dots p_k\).

A square-free integer \(n\) is divisible by no perfect squares. As a consequence, the prime factorization of a square-free integer \(n\) is

\[n = \prod_{i=1}^{k} p_i^{e_i} = \prod_{i=1}^{k} p_i .\]
Parameters

n (int) – A positive integer.

Returns

True if the integer \(n\) is square-free.

Return type

bool

Examples

In [1]: galois.is_square_free(10)
Out[1]: True

In [2]: galois.is_square_free(16)
Out[2]: False