For some reason when I type

FindInstance[a + b == c && CoprimeQ[a, b, c] == True, {a, b, c}, Integers]

Mathematica just immediately returns my input as its output, even though the very simple solution {1,2,3} should suffice. Why doesn't it even attempt to solve for this, and how can I fix it?


As with most *Q functions, CoprimeQ will evaluate to True or False immediately:



You could instead use GCD:

    a + b == c && And @@ Thread[GCD @@@ Subsets[{a, b, c}, {2}] == 1],
    {a, b, c},

{{a -> 1, b -> 0, c -> 1}}

although this approach won't work to find your example.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.