A342123 a(n) is the remainder when n is divided by its binary reverse.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 0, 0, 0, 0, 0, 19, 0, 0, 9, 23, 0, 6, 4, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 37, 13, 39, 0, 4, 0, 43, 5, 0, 17, 47, 0, 14, 12, 0, 8, 10, 0, 55, 0, 18, 12, 4, 0, 14, 0, 0, 0, 0, 0, 67, 0, 69, 21, 71, 0, 0, 33, 75, 1, 77, 21
Offset: 1
Examples
For n = 43, - the binary reverse of 43 ("101011" in binary) is 53 ("110101" in binary), - so a(43) = 43 mod 53 = 43.
Links
Programs
-
PARI
a(n, base=2) = { my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r }
-
Python
def A342123(n): return n % int(bin(n)[:1:-1],2) if n > 0 else 0 # Chai Wah Wu, Mar 01 2021
Comments