5. Let three numbers form an arithmetic sequence. If the smallest number is multiplied by 2, the largest number is increased by 7, and the other remains unchanged, the product of the new three numbers is 1000, and these three numbers form a geometric sequence. Then the common difference of the arithmetic sequence is ( ).
A. 8
B. $\pm 8$
C. 8 or 15
D. $\pm 15$
5. B.

Let the common difference be $d$, and the middle number be $a$. Then, when $d>0$, we have $a=10$, and $a^{2}=2(a-d)(a+d+7)=2(10-d)(17+d)=100$, solving which gives $d=8, d=-15$ (discard); when $d<0$, we have $a=10$, and $a^{2}=2(a+d)(a-d+7)$, solving which gives $d=-8, d=15$ (discard). Therefore, $d= \pm 8$.