%I #21 May 13 2018 07:38:01
%S 0,0,1,0,1,0,1,0,1,0,1,2,3,4,5,0,1,0,1,2,3,0,1,2,3,4,5,0,1,2,3,0,1,0,
%T 1,2,3,4,5,6,7,8,9,10,11,0,1,2,3,4,5,0,1,2,3,4,5,6,7,8,9,10,11,0,1,0,
%U 1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,8,9,10,11,0,1,2,3,4,5,6,7,0,1,2,3
%N Amount by which n exceeds the largest binary palindrome less than or equal to n.
%H Antti Karttunen, <a href="/A303534/b303534.txt">Table of n, a(n) for n = 0..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F a(n) = n - A206913(n).
%e The largest binary palindrome that doesn't exceed 30 is 27 (11011 r2). 30 - 27 = 3, so a(30) = 3.
%o (PARI) isA006995(n) = Vecrev(n=binary(n))==n;
%o a(n) = {my(k=0); while(!isA006995(n-k), k++); k;} \\ _Altug Alkan_, Apr 25 2018
%Y A006995 lists the binary palindromes.
%Y A206913 gives the largest binary palindrome that does not exceed n.
%Y Cf. also A261424 (analog in base 10), A280506, A303536.
%K nonn,easy,base,look
%O 0,12
%A _Allan C. Wechsler_, Apr 25 2018
%E More terms from _Altug Alkan_, Apr 25 2018