Symbolic Raku, 17 bytes
Try it online!
Suprisingly, this is shorter than the my previous Raku answer, though one byte longer than using the built-in
$_= # Set the output to
?( ) # The boolean of
$_ # If the input is
%% # Divisible by
[^] # Only one ...
tq, 10 bytes
Uses Wilson's theorem to do the prime-checking.
?-1! # Generate all numbers from 2 to input - 1
x, # Preserve this value, prevent it from being printed
p*p # Generate all possible combinations of those numbers
%? # Does the product of any combination equal to the input?
Spice, 93 bytes
;i;m;t;c;r@REA i;ADD 0 1 c;SUB i 1 m;ADD c 1 c;MOD i c t;SWI t 1 9;SWI c m 3;ADD 0 1 r;OUT r;
This outputs  for a prime, and  for a non-prime.
;i;m;t;c;r@ - Declare vars (@ marks end of declarations)
(line 0) REA i; - Read input into i
(line 1) ADD 0 1 c; - Set counter c = 1
(line 2) SUB i 1 m; - Set ...
W d, 5 bytes
(Possibly the only <=5-byter that does not use a prime or number factorization built-in?)
And, just for the lols (explanation for this program is also below, without the implicitly provided ba):
W d, 13 7 bytes
W doesn't have a boring primalty test operation, which is why this program is so long. (IMO a 7-byte ...