Determine whether a number is a Ludic prime - MATLAB Cody - MATLAB Central

Problem 60764. Determine whether a number is a Ludic prime

Difficulty:Rate
Ludic numbers are formed by a sieve. Start with a list of the positive integers. Skip 1 and start with 2. Then delete every second number after 2 (i.e., 4, 6, 8, 10, etc.). Then move to the next number after 2—i.e., 3—and delete every third number (9, 15, 21, etc.). The next number is 5, so delete every fifth number (19, 37, etc.). Unlike the Sieve of Eratosthenes, this remaining numbers are not all prime.
Write a function to determine whether a number is a Ludic prime. The function should return three logical variables that answer these questions: Is it a Ludic prime? Is it a Ludic number? Is it prime?

Solution Stats

85.71% Correct | 14.29% Incorrect
Last Solution submitted on Dec 04, 2024

Problem Comments

Solution Comments

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

Problem Recent Solvers5

Suggested Problems

More from this Author290

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