Imagine I have two numbers $m$ and $n$ now I can build tree graph with branching factor of n in this way:
The root of tree is m, in the second level of three each node has value $$k= \frac{m}{n+1}$$ and in the third level each node has value of $$k = \frac{k}{n+1}$$ and so on continue this process until the last level of tree which each node values is 1.
Now Given number of Ones which means leaf of tree and $m$ I want to find branching factor of three which means $n$ see picture below for more explanation

In this picture $m$ is $16$ and number of ones is $9$ as I said above in the second level of tree each node has value of $k= \frac{16}{3+1}$ which here is 4 and in the third level of tree each node is $k= \frac{4}{3+1}$ which here is 1 that is the last level of tree because each node value is 1 and the answer $n$ is $3$ branching factor of tree