Given a positive integer n, find its prime factors as well as all of its divisors.
Example: n=12 has prime factors [2,2,3] and divisors [1,2,3,4,6,12].
The challenge is to do so without using built-in algorithims. Banned functions include primes(), isprime(), and factor(). See the last test case for other banned functions.

Solution Stats

11 Solutions

7 Solvers

Last Solution submitted on Sep 28, 2025

Last 200 Solutions

Solution Comments

Show comments
Loading...

Problem Recent Solvers7

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!