OFFSET
0,3
LINKS
PROG
(Python)
def a065621(n): return n^(2*(n - (n&-n)))
def a048724(n): return n^(2*n)
def a054429(n): return 1 if n==1 else 2*a054429(int(n/2)) + 1 - n%2
def a193231(n):
if n<2: return n
if n%2==0: return a048724(a193231(n/2))
else: return a065621(1 + a193231((n - 1)/2))
def a(n): return n if n<2 else a054429(a193231(n)) # Indranil Ghosh, Jun 05 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 28 2013
STATUS
approved