Draft

Prime factorisation in index notation

Description:

You need to create a function ( primeFactorisation() )which takes a non-empty array, of non-negative integers as its argument and returns a 2-dimensional array containing the prime factorisation array of each of it's arguments' elements.

Three examples of correct prime factorisation arrays of 10, 17 and 60:

10 -> [ 1 , 0 , 1 ] //since 10 = 2^1 x 3^0 x 5^1

17 -> [ 0 , 0 , 0 , 0 , 0 , 0 , 1 ] //since 17 = 2^0 x 3^0 x 5^0 x 7^0 x 11^0 x 13^0 17^1

60 -> [ 2 , 1 , 1 ] //since 60 = 2^2 x 3^1 x 5^1

If an element of the given array does not have a prime factorisation, it should be ignored and not included in the returned array. The returned array's elements should be in order, starting with the prime factorisation representing the largest number and finish with the smallest.

primeFactorisation( [ 10 , 2 ] );

returns --> [ [1 , 0 , 1 ] , [ 1 ] ]

primeFactorisation( [ 2 , 10 ] );

Also returns (since 10>2) --> [ [ 1 , 0 , 1 ] , [ 1 ] ]

Mathematics

Stats:

CreatedAug 27, 2015
Warriors Trained134
Total Skips39
Total Code Submissions65
Total Times Completed20
JavaScript Completions20
Total Stars4
% of votes with a positive feedback rating73% of 13
Total "Very Satisfied" Votes9
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes3
Total Rank Assessments13
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • JMurphyWeb Avatar
Ad