A={{1,1,1,1},{1,5,10,25}} R=QQ[p,n,d,q, Degrees => transpose A] degree d degree q degree(p^4*n^8*d^10*q^3) h=basis({20,135},R) rank source h h rank source basis({100,1000},R) S=QQ[x,y,d,p,n,q, MonomialOrder=>Lex, MonomialSize =>16] I=ideal(p-x*y, n-x*y^5, d-x*y^10, q-x*y^25) transpose gens gb I Sq=S/I -- express one dollar in 10 coins x^10*y^100 -- we don't need any dime to express 10 dollars with 100 coins x^100*y^1000 -- we cannot express 10 dollars with less then forty coins x^39*y^1000 weight=(5,7,13,17) T=QQ[x,y,p,n,d,q, Weights=> {{1,1,0,0,0,0}, {0,0,weight}},MonomialSize =>16] describe T I=ideal(p-x*y, n-x*y^5, d-x*y^10, q-x*y^25) Tq=T/I -- express one dollar in 10 coins x^10*y^100 -- we don't need any dime to express 10 dollars with 100 coins x^100*y^1000 optimal solution which involves all four coins x^234*y^5677 load "LLL.m2" oneBinomial = (R,C,m)-> ( pos:=1_R; neg:=1_R; scan(numgens R, i->( a:=C_(i,m); if a>0 then pos=pos*R_i^a else neg=neg*R_i^(-a))); pos-neg) R=QQ[x_1..x_5, Weights=>{1,5,5,1,0}] A=matrix{{1,1,1,1,1},{0,1,2,1,0},{0,0,1,2,1}} B=matrix LLL syz A I= ideal apply(rank source B, i->(oneBinomial(R,B,i))) transpose gens gb I S=R/I x_1*x_2^(10)*x_3^(10)*x_4^4