Generate a list of composite numbers - MATLAB Cody - MATLAB Central

Problem 46600. Generate a list of composite numbers

Difficulty:Rate
Prime numbers get a lot of attention in Cody, while composite numbers get relatively little. Right now a search for "prime" on Cody yields 153 problems, while a search for "composite" yields only 27--and only eight of those deal with composite numbers. Let's work toward restoring the balance.
Write a function to list the composite numbers less than or equal to the input number. Remember that 1 is neither prime nor composite.

Solution Stats

72.0% Correct | 28.0% Incorrect
Last Solution submitted on Jan 06, 2025

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
18
8

Problem Recent Solvers50

Suggested Problems

More from this Author291

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page