Is it a Sphenic Number?
bash, 43 bytes
factor $1|awk '{print $2-$3&&$3-$4&&NF==4}'
Try it online!
Input via command line argument, outputs 0
or 1
to stdout.
Fairly self-explanatory; parses the output of factor
to check that the first and second factors are different, the second and third are different (they're in sorted order, so this is sufficient), and there are four fields (the input number and the three factors).
MATL, 7 bytes
_YF7BX=
Try it online! Or verify all test cases.
Explanation
_YF % Implicit input. Nonzero exponents of prime-factor decomposition
7 % Push 7
B % Convert to binary: gives [1 1 1]
X= % Is equal? Implicit display
C, 88 78 126 58 77 73 + 4 (lm
) = 77 bytes
l,j;a(i){for(l=1,j=0;l++<i;fmod(1.*i/l,l)?i%l?:(i/=l,j++):(j=9));l=i==1&&j==3;}
Ungolfed commented explanation:
look, div; //K&R style variable declaration. Useful. Mmm.
a ( num ) { // K&R style function and argument definitions.
for (
look = 1, div = 0; // initiate the loop variables.
look++ < num;) // do this for every number less than the argument:
if (fmod(1.0 * num / look, look))
// if num/look can't be divided by look:
if( !(num % look) ) // if num can divide look
num /= look, div++; // divide num by look, increment dividers
else div = 9;
// if num/look can still divide look
// then the number's dividers aren't unique.
// increment dividers number by a lot to return false.
// l=j==3;
// if the function has no return statement, most CPUs return the value
// in the register that holds the last assignment. This is equivalent to this:
return (div == 3);
// this function return true if the unique divider count is 3
}
Try it online!