Answer: 7 pigeons sitting on the branches, 5 pigeons under the tree
=12 in total
Step-by-step explanation:
Upper branch has x pigeons, lower has y.
Top branch said: "If one of you flies up to us our number will be double yours":
Well, if one of the bottom branch flies up, the top branch will have x+1 birds and the bottom will have (y−1). The top will have double the bottom, so:
x+1=2(y−1)
Top branch said: "If one of us flies down to you, our numbers will be equal":
Now, the top branch will have x−1 and the bottom y+1. The numbers should be equal:
x−1=y+1