this problem was solved many times (I do not remember who and when).
You can list all possible trees when you construct them by adding
one species at a time. For 3 taxa, there is a single topology.
Add the fourth taxon to one of the three branches (three ways).
You will get a tree of four taxa which has 5 branches.
Add the fifth taxon to one of the five branches (five ways).
And so on...
Each time you will add a new taxon to a tree of K taxa which
has 2K-3 branches. The total number of ways is the product of
(2K-3) for K=3,...,N-1.