The answer to this is x^2 + 2x - 5
Base B (aka p) is equivalent to 18
p=18
When expanding number, we should separate the numbers according to the places like the number 275 written in expanded form 200+70+5. So, in this question we must likely done like this. The number is 39,005 the sum that is written on expanded form is 30,000+9,000+5.