The polynomial p(x) is of degree 2017 and has non-negative integer coefficients which you don't know.
If you input a value like x=x0, the computer will output the value p(x0) at a cost of $1($2.25 for Denis).
If you want to determine all 2018 coefficients of p(x) at a minimum cost using only positive integer inputs, what is your cost in dollars?
Well since nobody replied I will give the answer. The answer is $2
First you input x
0=1 and the computer would give you p(1), which is the sum of all coefficents.
let s=p(1)
Then you input x
1= s+1, and the computer would give you p(s+1)
Converting p(s+1) to base s+1 and the digits correspond to the coefficients of p(x)
Because p(s+1) = d
2017(s+1)
2017 + d
2016(s+1)
2016 + ... +d
0
is exactly how we represent integers in base s+1
we use s=p(1) to make sure that the second number we input is larger than any of the coefficients.
For example, suppose the polynomial is 5x
2+3x+4
First, we set an input of x=1 and get 5+3+4 = 12
Now, we input that sum plus one, that is, x=13. 5(13)
2+3(13)+4=888
888 converted to base 13 is 534 which is the coefficients we want.
This is because if we backtrack and consider the meaning of 534 base 13, it's
4 copies of 1
3 copies of 13
5 copies of 13
2
that is, exactly 5(13)
2+3(13)+4
Compare this with the given solution and it should become clearer. Note since our base is always larger than the sum of the coefficients, it will always be possible to represent all coefficients as single digits.