login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 2

%I #8 Apr 10 2021 10:35:28

%S 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 31,31,31,31,31,31,32,32,32,33,36,37,38,39,40,41,42,43,46,47,47,47,56,

%U 57,58,59,62,63,63,63,62,63,63,63,63,63,63,63,64,64,64,64

%N 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 Leading zeros are ignored.

%C This sequence has similarities with A343049; here we scan the binary representations from left to right, there from right to left.

%H Rémy Sigrist, <a href="/A343271/b343271.txt">Table of n, a(n) for n = 0..8192</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F A070939(a(n)) = A070939(n).

%e The first terms, in decimal and in binary, are:

%e n a(n) bin(n) bin(a(n))

%e -- ---- ------ ---------

%e 0 0 0 0

%e 1 1 1 1

%e 2 2 10 10

%e 3 3 11 11

%e 4 4 100 100

%e 5 5 101 101

%e 6 7 110 111

%e 7 7 111 111

%e 8 8 1000 1000

%e 9 9 1001 1001

%e 10 10 1010 1010

%e 11 11 1011 1011

%e 12 14 1100 1110

%e 13 15 1101 1111

%e 14 15 1110 1111

%e 15 15 1111 1111

%o (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 Cf. A070939, A343049.

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Apr 10 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)