Is it true that Mathematica's Minimize function does not allow constraints like Mod[x,2]==0? I am trying to solve a MinuteMath puzzle with Mathematica:
What is the smallest possible average of four distinct positive even integers?
My "solution" looks like this:
vars = Subscript[x, #] & /@ Range[4];
cond = Apply[And, Mod[#, 2] == 0 & /@ vars] &&
(0 < Subscript[x, 1]) &&
Apply[And, Table[Subscript[x, i] < Subscript[x, i + 1], {i, 1, 3}]];
Minimize[{Mean[vars], cond}, vars, Integers]
but Minimize returns unevaluated. Additional question: Can I use EvenQ for defining the constraints? Problem is, EvenQ[x] returns False for undefined expressions x.