# Polynomials with variable coefficients.

Let $$P(x)$$ be a polynomial which takes its coefficients from the set $$\{0,1,2,3\}$$.

1. If $$P(3)= 80$$ then value of $$P(2)$$ can be?

Ans: $$30$$

1. The number of polynomials $$P(x)$$ such that $$P(2) =20$$ is

Ans: $$11$$

My Attempt

I can show that the degree of polynomial will be 3 but how to find the exact polynomial. However with small hit and trial I can see that the all the coefficients of the cubic will be $$2$$.

Question: How do I explain this other than hit and trial?

Let the polynomial be p(x)=ax^3+bx^2+cx+d. So p(3)=27a+9b+3c+d=80(given) As RHS is 2 modulo 3, LHS has to be 2 modulo 3. It follows that d is 2 modulo 3.(why?). As d belongs to (1,2,3,0), d=2. then substitute d=2 in p(3) and divide the whole equation by 3. You get 9a+3b+c=26. Similar iterations prove that a=b=c=2. Part 2 can be proved similarly.

So $27a+9b+3c+d=80$

One way of thinking about this is that it is very nearly just the ternary (base $3$) expression of $80$, except that $3$ is allowed as well as $0$.

A systematic method is to see that $80=3\times 26+2=3(9a+3b+c)+d$ from which $d=2$

Then $9a+3b+c=26=3\times 8+2$ whence $c=2$ etc

For the next example, you have $16a+8b+4c+2d+e=20$

$e$ must be even, so can be $0$ or $2$.

Let's take the case $e=2$, then $8a+4b+2c+d=9$ whence $d=1,3$ (two cases again)

And this is at least systematic.

You could also begin at the other end. If $a=1$ you need $b=0, 4c+2d+e=4$; otherwise $a=0$ and explore those possibilities.