List the first of three consecutive square-free numbers - MATLAB Cody - MATLAB Central

Problem 60787. List the first of three consecutive square-free numbers

Difficulty:Rate
The numbers 13, 14, and 15 are consecutive, of course, but they also share the property of being square-free. That is, each number has no prime factors that are repeated. Another group of three consecutive square-free numbers is 129, 130, and 131, and a bit of thought will show that the longest string of square-free numbers is three.
Write a function that returns the nth number in the sequence of the first numbers in these triples. Regarding the examples above, 13 and 129 are the third and nineteenth elements of the sequence.
Related Cody problems are 3002, 3003, and 56308.

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jan 20, 2025

Solution Comments

Show comments

Problem Recent Solvers4

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