Square-free integers: Difference between revisions

Content added Content deleted
(jq)
m (→‎{{header|jq}}: consistency)
Line 776: Line 776:
test for whether a number is square-free can be written in one line:
test for whether a number is square-free can be written in one line:


def square_free: . as $n | all( squares; divides($n) | not);
def is_square_free: . as $n | all( squares; divides($n) | not);


In words: to verify whether an integer, $n, is square_free, check that no admissible square divides $n.
In words: to verify whether an integer, $n, is square_free, check that no admissible square divides $n.