The 1st four terms of Arithmetic Progression:

$a_1, ~ a_1 + d, ~ a_1 + 2d, ~ a_1 + 3d$
The Geometric Progression:

$a_1 + 4, ~ a_1 + d + 2, ~ a_1 + 2d + 5, ~ a_1 + 3d + 18$
From the GP:

$\dfrac{a_1 + d + 2}{a_1 + 4} = \dfrac{a_1 + 2d + 5}{a_1 + d + 2} = \dfrac{a_1 + 3d + 18}{a_1 + 2d + 5}$

$\dfrac{a_1 + d + 2}{a_1 + 4} = \dfrac{a_1 + 2d + 5}{a_1 + d + 2} $

$(a_1 + d + 2)^2 = (a_1 + 4)(a_1 + 2d + 5)$

${a_1}^2 + d^2 + 4 + 2a_1d + 4a_1 + 4d = {a_1}^2 + 2a_1d + 5a_1 + 4a_1 + 8d + 20$

$d^2 - 4d - 5a_1 = 16$ ← Equation (1)

$\dfrac{a_1 + 2d + 5}{a_1 + d + 2} = \dfrac{a_1 + 3d + 18}{a_1 + 2d + 5}$

$(a_1 + 2d + 5)^2 = (a_1 + d + 2)(a_1 + 3d + 18)$

${a_1}^2 + 4d^2 + 25 + 4a_1d + 10a_1 + 20d = {a_1}^2 + 4a_1d + 20a_1 + 3d^2 + 24d + 36$

$d^2 - 4d - 10a_1 = 11$ ← Equation (2)

Equation (1) - Equation (2):

$5a_1 = 5$

$a_1 = 1$

From Equation (1):

$d^2 - 4d - 21 = 0$

$d = 7 ~ \text{and} ~ -3$ *answer*