I think the explanation in the problem statement is a bit sparse. The numbers in the table do not represent prime numbers per se: they represent indices on prime numbers, whose ultimate product yields the value n.
See http://mathworld.wolfram.com/PrimeFactorization.html
The in-built function factors() was pretty helpful for this problem :)
Nice!
I've been trying to submit an answer to this for over three hours. Other problems work fine, but this one keeps saying the server is offline.
I do not understand how this code passes the test.
How this is a solution
tabulate code is not working. I got the correct results but I am getting error --"Undefined function 'tabulate' for input arguments of type 'double"
Tabulate could probably be made to work here, but I recall that Cody does not allow toolbox functions, and tabulate lives in the stats toolbox. I'd guess the logic is that not everyone has all toolboxes, so a solution that uses some tool that others cannot use would not be fair to those others.
Definitely used a bit of a work around in this one. Sorry for that!
great problem...
can't believe 'deblank' can be used in this way
Replace NaNs with the number that appears to its left in the row.
2149 Solvers
All your base are belong to us
470 Solvers
260 Solvers
Find the maximum number of decimal places in a set of numbers
952 Solvers
3195 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!