>>> a=int(input('Enter base 10 natural number: '))
Enter base 10 natural number: 42
>>> b = bin(a)
>>> a = int(b[:2]+b[2:][::-1], 2)
>>> a
21