Message Boards Message Boards

What is the correct domain specification?

Posted 1 year ago

I am a newbie regarding Mathematica and this forum. Please let me know if my question should have been asked elsewhere.

If I wanted to solve three equations (eq) for {a, b, c}, where {a, b, c} are positive integers, I could write

    Solve[eq, {a, b, c}, PositiveIntergers].

My question is, how would I write the domain specification if the domain were the positive integers up to some maximum number, say 17? These attempts didn't work:

    Solve[eq, {a,b,c,}, PositiveIntegers<17]

    Solve[eq, {a, b, c} (a|b|c)∈Z_>0 && a<17 && b<17 && c<17]

Greg

POSTED BY: Greg Gruzalski

You can add those conditions to the equation:

Solve[eq && a < 17 && b < 17 && c < 17,
 {a, b, c}, PositiveIntergers]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract