Wonderful puzzle and I got many correct answers. Ones to send the answers were Pratik Poddar, Prakhar Prakash, Suman Saraf, Karan Sharma and Girish Tutakne.
The answer is that it can’t be done for 6 but can be done for 7 trees. Generally, can’t be done for even number of trees but can be done for odd number of trees. I am copying Girish’s answer verbatim (thanks Girish).
Explanation: Number trees 1 to 6 (or 7 or n). Each sparrow takes the tree number of the tree it is on. At the start, the total number achieved by adding the “sparrow-numbers” is 21 (or 28 or n.(n+1)/2).
With every move, the total sparrow number stays the same because for every sparrow increasing its sparrow number by +1 by moving to the right, a sparrow reduces it’s sparrow number by -1 by moving to the left.
If all sparrows need to be on the same tree, they need to be on the tree with number equal to the average of the 6 (or 7 or n) sparrows. This is only possible for n being odd because the average will be (n+1)/2, which is a natural number only for n being odd. And as it the central tree for all odd n, every odd n has a solution.
Hope you all enjoyed the puzzle!