2
$\begingroup$

I'm trying to solve something like this in Mathematica:

Solve[3*i + j == 5, {i, j}, Integers]

However, I want to specify that the domain is not just integers, but positive integers, so it can actually return the solution {i -> 1, j -> 2}, but I don't know how to do it. Is it possible to do this in Mathematica?

$\endgroup$

closed as off-topic by Daniel Lichtblau, MarcoB, b3m2a1, Henrik Schumacher, José Antonio Díaz Navas Feb 13 '18 at 12:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, MarcoB, b3m2a1, Henrik Schumacher, José Antonio Díaz Navas
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Help > Documentation Center will take you to the reference page for Solve. Third item under Details and Options indicates how to express inequalities. $\endgroup$ – Daniel Lichtblau Feb 10 '18 at 16:56
3
$\begingroup$
Solve[3*i + j == 5 && i > 0 && j > 0, {i, j}, Integers]

(*  {{i -> 1, j -> 2}}  *)
$\endgroup$

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