%mathpiper,def="IsComposite"

5  # IsComposite(1)			<-- False;
10 # IsComposite(n_IsPositiveInteger) 	<-- (Not IsPrime(n));

%/mathpiper



%mathpiper_docs,name="IsComposite",categories="User Functions;Number Theory;Predicates"
*CMD IsComposite --- test for a composite number
*STD
*CALL
	IsComposite(n)

*PARMS

{n} -- positive integer

*DESC

This function is the logical negation of {IsPrime}, except for the number 1, which is
neither prime nor composite.

*E.G.

In> IsComposite(1)
Result: False;
In> IsComposite(7)
Result: False;
In> IsComposite(8)
Result: True;
In> Select(1 .. 20, IsComposite)
Result: {4,6,8,9,10,12,14,15,16,18,20};

*SEE IsPrime
%/mathpiper_docs