I need to maximize a function that involves an alternating sum and a set of constraints. I have tried the following code:
NMaximize[{(-1)^{m}*n!, n + m == 7, m > 0, n > 0}, {m, n}]
However, the error message
NMaximize: The objective function {(-1)^m n!} should be scalar-valued
appears.
Are there any numerical maximization methods that can be used for functions like this?