summaryrefslogtreecommitdiff
path: root/progs/a411.py
blob: d854594e18218606827aec54dacf1dce8ce8ca65 (plain)
1
2
3
4
5
6
7
8
def odd_bit_set_number(n):
    count = 0;res = 0;temp = n
    while temp > 0:
        if count % 2 == 0:
            res |= (1 << count)
        count += 1
        temp >>= 1
    return (n | res)