Do we need to find all the solutions here? At the first look one might see that `2**(n - m + 1)` can grow large really quickly and slow down the things. But in the same time, since `n - m + 1 = m + 2` and  `m` is a considerably small number most of the time, this won't have a much effect on the speed. But I think If it is possible to avoid computing all the solutions, we should only find one solution.