Compute the largest number whose prime factors sum to n - MATLAB Cody - MATLAB Central

Problem 52956. Compute the largest number whose prime factors sum to n

Difficulty:Rate
This problem deals with a sequence whose tenth term is 36 because the prime factors of 36 (2, 2, 3, 3) sum to 10. The number 32 would also fit, but the elements of this sequence are the largest possible examples.
Write a function to produce the nth term in this sequence. In other words, compute the largest number whose prime factors sum to n. Take the first term in the sequence to be 1.

Solution Stats

52.0% Correct | 48.0% Incorrect
Last Solution submitted on Dec 06, 2024

Problem Comments

Solution Comments

Show comments
MATLAB Central 2024 In Review
...
Let's celebrate what made 2024 memorable! Together, we made big impacts, hosted...

Problem Recent Solvers11

Suggested Problems

More from this Author287

Community Treasure Hunt

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

Start Hunting!
Go to top of page