A383593 In the binary expansion of n, change the most significant 0 bit to 1, if there is any 0 bit.
1, 1, 3, 3, 6, 7, 7, 7, 12, 13, 14, 15, 14, 15, 15, 15, 24, 25, 26, 27, 28, 29, 30, 31, 28, 29, 30, 31, 30, 31, 31, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 56, 57, 58, 59, 60, 61, 62, 63, 60, 61, 62, 63, 62, 63, 63, 63, 96, 97, 98, 99, 100
Offset: 0
Examples
a(25) = 29 since 25 = 11001_2 becomes 11101_2 = 29.
Links
- Michael S. Branicky, Table of n, a(n) for n = 0..16383
Programs
-
Python
def a(n): return int(bin(n)[2:].replace('0', '1', 1), 2) print([a(n) for n in range(70)]) # Michael S. Branicky, Jun 11 2025
-
Python
def A383593(n): return (n if (t:=bin(n)[2:].find('0'))==-1 else n+(1<
Chai Wah Wu, Jun 17 2025
Formula
a(n) = n + floor(2^(A063250(n)-1)) for n > 0. - David Radcliffe, Jun 12 2025
Comments