Pairing numbers (a,b) in an array such a way that a*2 >=b

I suggest that the answer is a.length / 2. Half of the length of the array (rounded down if the length was odd). You can pair the numbers any way you like. For non-negative a and b if a * 2 < b, just swap a and b and you will have a * 2 >= b. So since it takes two numbers to make a pair, you can always form precisely as many pairs as half of the length of the array.

Example (from the comments): [1, 2, 2, 2]. Length is 4, half of the length is 2, so there should be 2 pairs. Let’s check: (1, 2) is a nice pair because 1 * 2 >= 2. (2, 2) is another nice pair since 2 * 2 >= 2. In this case we didn’t even need any swapping (on the other hand the same pairs would have worked with swapping too: 2 * 2 >= 1 and 2 * 2 >= 2).

It will not always work if the array may contain negative numbers. So you may want to add a validation of the array that checks that it doesn’t.

What went wrong in your solution?

Your recursive algorithm is wrong. Say the array is [2, 3, 7, 9]. Clearly (2, 3) and (7, 9) are nice pairs, so there are two pairs here. The way you describe your algorithm, since (2, 9) is not a valid pair, you discard at least one of 2 and 9, leaving no chance of forming two pairs from the remaining numbers.