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 A343271 #8 Apr 10 2021 10:35:28 %S A343271 0,1,2,3,4,5,7,7,8,9,10,11,14,15,15,15,16,16,18,19,20,21,23,23,28,29, %T A343271 31,31,31,31,31,31,32,32,32,33,36,37,38,39,40,41,42,43,46,47,47,47,56, %U A343271 57,58,59,62,63,63,63,62,63,63,63,63,63,63,63,64,64,64,64 %N A343271 From left to right: the k-th binary digit of a(n) is the most frequent digit among the first k binary digits of n (in case of a tie, take the k-th binary digit of n). %C A343271 Leading zeros are ignored. %C A343271 This sequence has similarities with A343049; here we scan the binary representations from left to right, there from right to left. %H A343271 Rémy Sigrist, <a href="/A343271/b343271.txt">Table of n, a(n) for n = 0..8192</a> %H A343271 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A343271 A070939(a(n)) = A070939(n). %e A343271 The first terms, in decimal and in binary, are: %e A343271 n a(n) bin(n) bin(a(n)) %e A343271 -- ---- ------ --------- %e A343271 0 0 0 0 %e A343271 1 1 1 1 %e A343271 2 2 10 10 %e A343271 3 3 11 11 %e A343271 4 4 100 100 %e A343271 5 5 101 101 %e A343271 6 7 110 111 %e A343271 7 7 111 111 %e A343271 8 8 1000 1000 %e A343271 9 9 1001 1001 %e A343271 10 10 1010 1010 %e A343271 11 11 1011 1011 %e A343271 12 14 1100 1110 %e A343271 13 15 1101 1111 %e A343271 14 15 1110 1111 %e A343271 15 15 1111 1111 %o A343271 (PARI) a(n, base=2) = { my (d=digits(n, base), f=vector(base), t); for (k=1, #d, f[1+d[k]]++; if (f[1+d[k]]==vecmax(f), t=d[k], d[k]=t)); fromdigits(d, base) } %Y A343271 Cf. A070939, A343049. %K A343271 nonn,base %O A343271 0,3 %A A343271 _Rémy Sigrist_, Apr 10 2021