cp's OEIS Frontend

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.

A115516 The mode of the bits of n (using 0 if bimodal).

This page as a plain text file.
%I A115516 #6 May 21 2024 15:23:13
%S A115516 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,
%T A115516 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,
%U A115516 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
%N A115516 The mode of the bits of n (using 0 if bimodal).
%C A115516 If n is a term of A044951, A115517(n) = a(n); otherwise, A115517(n) = 1 and a(n) = 0 (and n is a term of A031443).
%H A115516 Paolo Xausa, <a href="/A115516/b115516.txt">Table of n, a(n) for n = 0..10000</a>
%F A115516 a(A031443(k))=0 for k>=1.
%e A115516 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).
%e A115516 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.).
%t A115516 Array[Min[Commonest[IntegerDigits[#, 2]]] &, 100, 0] (* _Paolo Xausa_, May 21 2024 *)
%o A115516 (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,","))}
%Y A115516 Cf. A115517 (same but use 1 if bimodal), A031443 (n's bits bimodal), A044951 (n's bits unimodal), A115353 (mode of n's decimal digits).
%K A115516 base,nonn
%O A115516 0,1
%A A115516 _Rick L. Shepherd_, Jan 23 2006