Solving system of linear equations when x_i are in specified set



Hey

I'm new in Maxima and today I've tried to study it a little bit.  I need to
solve 12 linear equations with 20 variable values (x1,.....x20) to find.
All x_i are different, natural and 1<= x_i <=20 for any i. (So the set
{x1,....x20} should be equal to {1,...20}). I've written some code but I
can't explain maxima my restrictions on x_i. Any ideas?


Best wishes,
Kakadu


P.S. My source is below

(%i8) kill(all)$
debugmode(false)$
load(to_poly_solve)$
(%i3) exes: makelist (concat (x,i), i, 20)$
answers: makelist(i,i,20)$
(%i5) simpsum: true$
map(lambda([x],assume(x>=1)),exes)$
map(lambda([x],assume(x<=20)),exes)$
(%i8) eqs: [6*x1+3*x2=2*x3+7*x4, 2*x5+x6=5*x7, 3*x9=2*x8,
4*(x8+x9)=x5+x6+x7+2*(x1+x2+x3+x4), 2*x20+x19=3*x17+x18, 3*x14=x15+2*x16,
x14+x15+x16=2*(x17+x18+x19+x20), 2*x10=x11, 3*x12=4*x13, x10+x11=x12+x13,
3*(x1+x2+x3+x4+x5+x6+x7+x8+x9)+x10+x11+x12+x13=x14+x15+x16+x17+x18+x19+x20]$
(%i9) to_poly_solve( cons(lsum(x,x,exes)=210,eqs), exes);
(%o9)
%union([x1=%c37,x10=%c38,x11=2*%c38,x12=(12*%c38)/7,x13=(9*%c38)/7,x14=%c39,x15=-5*%c39-4*%c38+210,x16=4*%c39+2*%c38-105,x17=%c40,x18=%c41,x19=-3*%c41-5*%c40-2*%c38+105,x2=%c42,x20=(4*%c41+8*%c40+2*%c38-105)/2,x3=%c43,x4=-(2*%c43-3*%c42-6*%c37)/7,x5=%c44,x6=-(49*%c44+30*%c43+60*%c42+84*%c38+78*%c37-1470)/42,x7=(35*%c44-30*%c43-60*%c42-84*%c38-78*%c37+1470)/210,x8=(30*%c43+60*%c42-126*%c38+78*%c37+2205)/350,x9=(10*%c43+20*%c42-42*%c38+26*%c37+735)/175])
(%i10) kill(all)$