I have the following piece of code in Mathematica:
a = {1, 2};
b = {2, 3};
f[i_, j_] := a[[i]]^2 + b[[j]]^2;
Maximize[{f[i, j], 1 <= i <= 2 && 1 <= j <= 2}, {i, j}, Integers]
By running it I get:
Part::pspec: Part specification i is neither a machine-sized integer nor a list of machine-sized integers. >>
Part::pspec: Part specification j is neither a machine-sized integer nor a list of machine-sized integers. >>
Could anyone help me out?