login
A319409
a(n) = n - A318921(n).
2
0, 1, 2, 2, 4, 5, 5, 4, 8, 9, 10, 10, 10, 12, 11, 8, 16, 17, 18, 18, 20, 21, 21, 20, 20, 23, 25, 24, 22, 26, 23, 16, 32, 33, 34, 34, 36, 37, 37, 36, 40, 41, 42, 42, 42, 44, 43, 40, 40, 45, 48, 46, 50, 52, 51, 48, 44, 51, 55, 52, 46, 54, 47, 32, 64, 65, 66, 66, 68, 69, 69, 68, 72, 73, 74, 74, 74, 76, 75, 72, 80, 81, 82, 82, 84, 85, 85, 84, 84, 87, 89, 88, 86, 90, 87, 80, 80
OFFSET
0,3
COMMENTS
How much n decreases by when its binary runs are all shortened by one bit.
LINKS
FORMULA
a(n) = n iff n is a Fibbinary number (A003714). - Rémy Sigrist, Sep 25 2018
PROG
(PARI) a(n) = my (p=-1, d=0, b=1, r=n); while (r, my (l=r%2); if (p!=l, p=l, d+=l*b; b*=2); r\=2); n-d \\ Rémy Sigrist, Sep 25 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Sep 19 2018
STATUS
approved