To test if p - 1 is a factor of p^2 + p + p - k, we can use synthetic division.
Place the coefficients of p^2 + p + p - k in the top row of the division table, and write (p - 1) to the left, outside of the table:
| 1 1 1 -k
1 |__________
|
Bring down the first coefficient of 1:
| 1 1 1 -k
1 |__________
| 1
Multiply the 1 by (p - 1) to get p - 1:
| 1 1 1 -k
1 |__________
| 1
|__________
Add the entries diagonally (1 and 1) to get 2 and write the result under the next coefficient of 1:
| 1 1 1 -k
1 |__________
| 1
|__________
2
Multiply the 2 by (p - 1) to get 2p - 2:
| 1 1 1 -k
1 |__________
| 1
|__________
2
-2p+2
Add the entries diagonally (2 and 1) to get 3 and write the result under the next coefficient of 1:
| 1 1 1 -k
1 |__________
| 1
|__________
2
-2p+2
________
3
Multiply the 3 by (p - 1) to get 3p - 3:
| 1 1 1 -k
1 |__________
| 1
|__________
2
-2p+2
________
3
-3p+3
Add the entries diagonally (3 and 1) to get 4 and write the result under the next coefficient of -k:
| 1 1 1 -k
1 |__________
| 1
|__________
2
-2p+2
________
3
-3p+3
________
4
The remainder is 4, which means that p - 1 is a factor of p^2 + p + p - k if k = 4.
Therefore, the value of k is 4.