2 answers
(click or scroll down)
if they were all the same, they'd be 8. So, leave the 8 and move the others away in each direction.
7+8+9 = 24
Or, if you insist on an algebraic solution, let x be the middle number. Then
x-1 + x + x+1 = 24
Now solve for x (I bet it'll be x=8)