Finding unknown base from equation

I am given this equation of an unknown base:

$\displaystyle x^2 - 10x +25$

It has a solution of x=5 and x=8 which are likely to be in our base 10.

I tried to find out the unknown base by comparing the co-efficients of the equations by doing so:

$\displaystyle (x-5)(x-8) = x^2 - 13x + 40 $ <--in base 10

$\displaystyle x^2 - 10x +25 $ <--in unknown base

Then I try to solve for the unknown base:

1*b = 13, b=13

but...

5*1 + 2*b = 40

2b = 35

b=17.5

How can the b in the equations be different? If this is the case, what is the actual base for the equation?

thanks!