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.
%I A330717 #12 Jan 01 2020 11:24:32 %S A330717 0,1,1,3,1,5,3,7,1,9,5,5,3,3,7,15,1,17,9,9,5,21,5,5,3,3,3,27,7,7,15, %T A330717 31,1,33,17,17,9,9,9,9,5,5,21,21,5,45,5,5,3,3,3,51,3,3,27,27,7,7,7,7, %U A330717 15,15,31,63,1,65,33,33,17,17,17,17,9,73,9,9,9,9 %N A330717 a(n) is the greatest binary palindrome of the form floor(n/2^k) with k >= 0. %C A330717 In other words, a(n) is the greatest binary palindromic prefix of n. %H A330717 Rémy Sigrist, <a href="/A330717/b330717.txt">Table of n, a(n) for n = 0..8192</a> %H A330717 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A330717 A070939(a(n)) = A215467(n). %F A330717 a(n) = 1 iff n is a power of 2. %F A330717 a(n) <= n with equality iff n is a binary palindrome (A006995). %F A330717 a(a(n)) = a(n). %F A330717 a(2*n) = a(n). %e A330717 The first terms, alongside the binary representations of n and of a(n), are: %e A330717 n a(n) bin(n) bin(a(n)) %e A330717 -- ---- ------ --------- %e A330717 0 0 0 0 %e A330717 1 1 1 1 %e A330717 2 1 10 1 %e A330717 3 3 11 11 %e A330717 4 1 100 1 %e A330717 5 5 101 101 %e A330717 6 3 110 11 %e A330717 7 7 111 111 %e A330717 8 1 1000 1 %e A330717 9 9 1001 1001 %e A330717 10 5 1010 101 %e A330717 11 5 1011 101 %o A330717 (PARI) a(n,b=2) = { my (d=digits(n,b)); forstep (w=#d, 1, -1, my (h=d[1..w]); if (h==Vecrev(h), return (fromdigits(h, b)))); return (0) } %Y A330717 Cf. A006995, A215467. %K A330717 nonn,base,easy %O A330717 0,4 %A A330717 _Rémy Sigrist_, Dec 28 2019