# Problem 59691. Find the minimum element coprime to the rest in a set of 10 consecutive integers

In this video, Dr Barker argued that a set of 10 consecutive integers must have at least one integer coprime to the rest. For example, in the set 20:29, both 23 and 29 are coprime to the other elements of the set.
The argument proceeds like this: In a set of 10 consecutive integers, five are even, and five are odd. The even numbers are not coprime because they share a factor of 2 (at least). Of the five odd numbers, at most two will be divisible by 3, one will be divisible by 5, and one will be divisible by 7. Aside from 1, the remaining number will not be divisible by any number less than 10, and if the remaining number is divisible by a number greater than 10, there cannot be another number in the set divisible by the same number. Therefore, at least one of the numbers in the set is coprime to the others.
Write a function that takes the smallest number in the set and produces the smallest number coprime to the others as well as the number of coprime integers. If the input is 20, then the function should return 23 and 2.

### Solution Stats

20.0% Correct | 80.0% Incorrect
Last Solution submitted on Mar 15, 2024

### Community Treasure Hunt

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

Start Hunting!