giving n positive integers a1,a2,...,an. gcd(a1,a2,...,an)=1. define f(x1,x2,...,xn)=a1*x1+a2*x2+a3*x3+...+an*xn(xi>=0). what is the maximum number b that can not be expressed by f(x1,x2,...,xn)? x1,x2,...,xn are all non-negative integers.
I already know the answer for n=2, it's equal to a1*a2-a1-a2. but when n>2,I can't get it. can anyone give me some hints?
It seems that if gcd(a1,a2...,an)=1 then you can express every number, don't you?
No. For example, min(a1,a2,...,an)-1 can't be expressed.
Oh, now I see that all values xi must be non-negative, you're right.
No polynomial solution is known for this problem. Read this Wikipedia page for more information.
thanks, I first known this problem in the book "A Friendly Introduction to Number Theory", it ask you to solve with the situation n=2. When I work it out and try to solve with n=3, I find it's quite another one. That's really a pity that this problem can't be described by a beautiful formula or algorithm.