Is there a method to generate an array of arrays representing prime factors and then filter it to retain only the necessary factors to generate numbers in a given set?
For example, for numbers 1-16
, the array set would look like this:
[ [2,2,2,2], [3,3], [5], [7], [11], [13] ]