Get all prime factors - MATLAB Cody - MATLAB Central

Problem 43269. Get all prime factors

Difficulty:Rate

List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as twice Examples:

in = 24 ---> out = [3 2 2 2]

in = 876 ---> out = [73 3 2 2]

Solution Stats

57.02% Correct | 42.98% Incorrect
Last Solution submitted on May 06, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Group

Prográmky Image
Prográmky
  • 10 Problems
  • 84 Finishers

Problem Recent Solvers861

Problem Tags

Community Treasure Hunt

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

Start Hunting!