OFFSET
0,2
EXAMPLE
PROG
(Python)
def A348074(n):
if n%2==0:
if n==0: return 1
else: return (1<<int.bit_length(n)) - n - 1 #A035327(n)
else: return 3*n+1
(Python)
def A348074(n): return 3*n+1 if n&1 or n==0 else (~n)^(-1<<n.bit_length()) # Chai Wah Wu, Dec 20 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Alexander Van Plantinga, Sep 27 2021
STATUS
approved