Determine whether an integer is square-free [FINALIZED]
+3
−0
An integer is called square-free if it is not a multiple of a perfect square other than 1. For example, 42 is square-free, but 44 is not because it is a multiple of the perfect square 4 = 2².
Your task is to write a program or function that takes a positive integer, and returns a truthy value if the integer is square-free and a falsey value otherwise.
This is code golf, the shortest code wins.
0 comment threads