OFFSET
1,2
MAPLE
f:= proc(N) local i, j, obj, cons;
obj:= add(i*x[i], i=1..2*N-1);
cons:= {seq(seq(x[i]+x[j]<=1, j=2*i..2*N-1, i), i=1..N),
add(x[i], i=1..2*N-1)=N};
Optimization:-Minimize(obj, cons, assume=binary)[1]
end proc:
map(f, [$1..60]); # Robert Israel, May 06 2019
MATHEMATICA
a[n_] := Module[{obj, cons},
obj = Sum[i*x[i], {i, 1, 2n-1}];
cons = Append[Flatten[Table[Table[x[i]+x[j] <= 1, {j, 2i, 2n-1, i}], {i, 1, n}], 1], AllTrue[Array[x, 2n-1], 0 <= # <= 1&] && Sum[x[i], {i, 1, 2n-1}] == n];
Minimize[{obj, cons}, Array[x, 2n-1], Integers][[1]]];
Reap[For[n = 1, n <= 50, n++, Print[n, " ", a[n]]; Sow[a[n]]]][[2, 1]]; (* Jean-François Alcover, May 17 2023, after Robert Israel *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David Brown, Mar 06 2010
EXTENSIONS
Extended by Ray Chandler, Mar 19 2010
STATUS
approved