OFFSET
2,1
FORMULA
a(2) = 7. For n >=2: a(2^n) = 2^(n+1) + 2; for m such that 2^(n-1)+1 <= m <= 2^n-1, a(m) = 2^n.
PROG
(Python)
def a(n):
if n == 2: return 7
digs = n.bit_length()
return int(2**digs) if n != 2**(digs - 1) else int(2**digs + 2)
print([a(n) for n in range(2, 71)]) # Michael S. Branicky, Jul 04 2021
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Leroy Quet, Sep 17 2009
EXTENSIONS
Extended by Ray Chandler, Mar 13 2010
STATUS
approved