login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A301572
a(n) = distance from n to nearest Fibbinary number (A003714).
1
0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 3, 2, 1, 0, 0, 0, 1, 0, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 3, 2, 1, 0, 0, 0, 1, 0, 0
OFFSET
0,13
COMMENTS
This sequence is unbounded.
FORMULA
a(n) = 0 iff n belongs to A003714.
0 <= 2 * a(n) - a(2 * n) <= 1.
EXAMPLE
a(12) = a(14) = 2 because 10 is the nearest Fibbinary number to 12 and 16 is the nearest Fibbinary number to 14.
PROG
(PARI) a(n) = for (k=0, oo, if (bitand(n-k, 2*(n-k))==0 || bitand(n+k, 2*(n+k))==0, return (k)))
CROSSREFS
Cf. A003714.
Sequence in context: A049336 A017888 A017878 * A017868 A353158 A334476
KEYWORD
nonn,base,look
AUTHOR
Altug Alkan and Rémy Sigrist, Mar 23 2018
STATUS
approved