Problem 60990. Find the Prime Factors and Divisors of a Number

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

85.71% Correct | 14.29% Incorrect
Last Solution submitted on Aug 09, 2025

Solution Comments

Show comments

Problem Recent Solvers5

Suggested Problems

More from this Author2

Problem Tags

Community Treasure Hunt

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

Start Hunting!