Method will return list of all primes for provided number.
For example for number 18 it should return following list of primes
[2, 3, 3].
- Source:
Parameters:
Name | Type | Description |
---|---|---|
number |
Number
|
Number for which method will find all primes. |
Returns:
- Type:
-
Array
List of available primes for provided number.
Example
var primeFactorTree = require('path-to-algorithms/src/prime-factor-tree')
.primeFactorTree;
console.log(primeFactorTree(18)); // [2, 3, 3]
console.log(primeFactorTree(600851475143)); // [71, 839, 1471, 6857]