Efficient Algorithm to Find the n-th Odious Number
Here is the recursive formula for odious numbers,
$$\begin{align}
a_1&amp;=1,\\
a_{2n} &amp;= 6n-3 -a_n,\\
a_{2n+1} &amp;= a_{n+1} + 2n.
\end{align}$$
The formula can be proved easily by observing, as greybeard pointed out, there is exactly one odious number among $2k-1, 2k$ for all positive integer $k$.
Here is a simple algorithm in Python to compute the $n$-th odious number.
def odious_number(n):
    if n == 1:
        return 1
    if n % 2 == 0:
        return 3 * (n - 1) - odious_number(n // 2)
    else:
        return odious_number((n + 1) // 2) + n - 1


if __name__ == &quot;__main__&quot;:
    for i in range(1, 16):
        print(odious_number(i), end=&quot;, &quot;)
    # Output: 1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 


There is also a &quot;closed&quot; formula.
$$a_n = 2n - 1 - \text{hamming_weight}(n - 1)\ \%\ 2$$
So, we have the following one-liner.
def odious_number(n):
    return 2 * n - 1 - (n - 1).bit_count() % 2

 int.bit_count(), which returns the Hamming weight of an integer, is available since Python 3.10. Before that version of Python, we can use, for example, bin(i).count('1').