← RoseCode

ROSECODE 564

Distinct trees II

C_K_Yang · Math ·

Let T(n,m) be the number of distinct trees with n nodes where the distance between any two nodes is no more than m. The distance between two vertices p and q is the number of edges we will come across as we travel from vertex p to vertex q in the shortest path. Two trees are not considered distinct if they are isomorphic.

For example, T(6,3)=3. Three distinct trees are shown below.

You are given T(15,4)=128 and T(50,7)270742753(mod1000000007)

Find T(1000,15)mod1000000007