OFFSET
1,2
FORMULA
a(n) = floor(A057716(n) / 2). - Kevin Ryde, Apr 28 2024
PROG
(PARI) a(n) = n++; my(k=logint(n, 2)); n+=k; (n + bittest(n, k+1)) >> 1; \\ Kevin Ryde, Apr 28 2024
(Python)
def A274089(n): return n+(k:=n.bit_length())+bool(n+k&(1<<k))>>1 # Chai Wah Wu, Sep 05 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 10 2016
STATUS
approved