5 lines
160 B
Text
5 lines
160 B
Text
semiPrimeQ[n_Integer] := Module[{factors, numfactors},
|
|
factors = FactorInteger[n] // Transpose;
|
|
numfactors = factors[[2]] // Total ;
|
|
numfactors == 2
|
|
]
|