I'm sorry in advance if this question is not appropriate. I'm no expert in graph theory or in combinatorics, but I've stumbled on this question while working on something else; I'll appreciate any input about it.
I'm going to grow a tree with the following algorithm.
- Create a variable $i$ as a counter, that will start at $0$. Start with a single white vertex, which will be the root.
- Increment the counter $i$ by 1.
- From each lowest white vertex, create $m$ downgoing white children vertices, numbered $1$ through $m$. (All the new vertices have the same height wrt the root: the height is equal to $i$. Also, the root has no number assigned to it.)
- From each of these new children vertices, follow the path back to the root. If the number assigned to this new child vertex already appears $k$ times in the path back to the root, not including the new vertex itself, remove the vertex from the tree.
- Turn black each of these new children vertices whose number is congruent to $i$ modulo $m$.
- Repeat steps 2-5, until you can't create any more vertices.
How many (total, black and white) leaves will this tree have?
Just to make sure the process is clear, here is the image
for the final tree in the case $m=3, k=2$ (correction: the rightmost black 3 in the 3rd row should not be there). The total number of leaves in this case is 33 32. Sorry for the very bad quality of this tree.