cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A301572 a(n) = distance from n to nearest Fibbinary number (A003714).

This page as a plain text file.
%I A301572 #14 Mar 26 2018 02:04:40
%S A301572 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,
%T A301572 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,
%U A301572 1,0,0,1,1,0,0,0,1,2,3,2,1,0,0,0,1,0,0
%N A301572 a(n) = distance from n to nearest Fibbinary number (A003714).
%C A301572 This sequence is unbounded.
%H A301572 Altug Alkan, <a href="/A301572/b301572.txt">Table of n, a(n) for n = 0..10000</a>
%H A301572 <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a>
%F A301572 a(n) = 0 iff n belongs to A003714.
%F A301572 0 <= 2 * a(n) - a(2 * n) <= 1.
%e A301572 a(12) = a(14) = 2 because 10 is the nearest Fibbinary number to 12 and 16 is the nearest Fibbinary number to 14.
%o A301572 (PARI) a(n) = for (k=0, oo, if (bitand(n-k, 2*(n-k))==0 || bitand(n+k, 2*(n+k))==0, return (k)))
%Y A301572 Cf. A003714.
%K A301572 nonn,base,look
%O A301572 0,13
%A A301572 _Altug Alkan_ and _Rémy Sigrist_, Mar 23 2018