|
|
A115516
|
|
The mode of the bits of n (using 0 if bimodal).
|
|
2
|
|
|
0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(5)=1 because 5 = 101 (binary) and 0 occurs once, but 1 occurs twice, so 1 is the mode. 5 is a member of A044951 (Numbers with no two equally numerous base 2 digits).
a(10)=0 because 10 = 1010 (binary), where 0 and 1 each occur twice. As these bits are bimodal, 0 is chosen. 10 is a member of A031443 (Digitally balanced numbers: numbers which in base 2 have the same number of 0's as 1's.).
|
|
MATHEMATICA
|
Array[Min[Commonest[IntegerDigits[#, 2]]] &, 100, 0] (* Paolo Xausa, May 21 2024 *)
|
|
PROG
|
(PARI) {for(n=0, 104, b=binary(n); l=length(b); s=sum(m=1, l, b[m]); if(s>l-s, a=1, a=0); print1(a, ", "))}
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|