For p(x) to be divisible by x−1, sum of coefficients should be equal to 0.
Let the number be 'a' that is to be subtracted from the polynomial.
5x+8−a is divisible by x−1. So, 5+8−a=0→a=13.
x2−2x+1−a is divisible by x−1. So, 1−2+1−a=0→a=0.
x3+x2+1−a is divisible by x−1. So, 1+1+1−a=0→a=3.