3. The next number in the sequence

Given a number n, find the next largest number m such that it contains the same number of 1s in its binary representation.

Sample Input:
10
12
92
Sample Output:
12
17
99
Binary representations of numbers used
DecimalBinary
101010
121100
1710001
921011100
991100011