We have 27 apple slices
each of 4 friends ate the same number of apple slices
there were 3 apple slices left
So we have
x+3=27
but there were 4 friends
so 4x+3=27
The 4x for the number of slices by a friend plus the slices left equal the number of slices
Answer: 4x+3=27