Problem 42704. prime to each other
Given two integers n1, n2 greater than 1, find out if they have common divisors or are prime to each other. Return "true" if they have common divisors and "false" if they are prime to each other.
Solution Stats
Problem Comments
-
2 Comments
Guillaume
on 6 Jan 2016
It seems to me that the logic of the test suite is reversed. You're asking if the numbers are coprime and yet want 0 (false) when they are.
George-Felix Leu
on 6 Jan 2016
@Guillaume: Your are right.
I re-wrote the text. The english got worse, but the clarity increased, I hope:))
Solution Comments
Show commentsProblem Recent Solvers58
Suggested Problems
-
How to find the position of an element in a vector without using the find function
2706 Solvers
-
Back to basics 23 - Triangular matrix
974 Solvers
-
Simple equation: Annual salary
4168 Solvers
-
Natural numbers in string form
1375 Solvers
-
Test Problem; Create a 5x5 array containing all ones
379 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!