Hi there, your question is a bit unclear, so I'm going to rewrite it as follows.
A witch decided to visit three friends and carried 7 apples. She has to cross a river before getting to each of the friends. So as she crosses the first river the apples double in the basket. She then gives so many apples to the first friend. She continues the journey and crosses the second river, the number of apples doubles again and and she give the same number to the second friend. She cross a river for the third time and the apples double and she gave the same number again to the third friend. There are no apples left. How many apples did she give to each friend.
Let X be the number of apples she gave to each friend.
1st crossing
7 --> 14 - X (i.e. 7 apples become 14 apples and have X apples taken away)
2nd crossing
14 - X --> 2(14 - X) - X (i.e. (14 - X) apples become 2(14 - X) apples and have X apples taken away)
3rd crossing
2(14 - X) - X --> 2(2(14 - X) - X) - X (i.e. 2(14 - X) - X apples become 2(2(14 - X) - X) apples and have X apples taken away)
2(2(14 - X) - X) - X is number of apples left after 3 crossings. i.e.
2(2(14 - X) - X) - X = 0
2(28 - 3X) - X = 0
56 - 7X = 0
7X = 56
X = 8
Answer: witch gives each friend 8 apples