Hello, #John, you wrote: J> Hello, J> it is necessary to write the code which finds all x1... xn: J> - J> |a1*x1+a2*x*2... an*xn=M; J> |x1... xn <=K; (any x no more given number) J> - (a, x) =M find n-1 vectors y1... y (n-1) such what (a, y) =0 result write down in a type x=x0+c1*y1 +... +c (n-1) *y (n-1) and already solve restrictions for x through c J> e.g. J>120*x1+26*x2+51*x3+24*x4+98*x5+91*x6+47*x6+60*x7=3166 J> K = 15; whether J> There is any formula for the decision of such equations? J> while comes to mind - to adapt ant . a = {120,26,51,24,98,91,47,60} y [1] = {26,-120,0,0,0,0,0,0} y [2] = {0,51,-26,0,0,0,0,0} y [3] = {0,0,24,-51,0,0,0} y [4] = {0,0,0,98,-24,0,0} y [5] = {0,0,0,0,47,-91,0} y [6] = {0,0,0,0,0,60,-47} x=x0 + c1*y1 +... c6*y6 where x0 - any decision for example x0 = {3166/120,0,0,0,0,0,0,0} and further drive c1. c6 but so to satisfy x1. xn <K