%I A031443
%S A031443 2,9,10,12,35,37,38,41,42,44,49,50,52,56,135,139,141,142,147,
%T A031443 149,150,153,154,156,163,165,166,169,170,172,177,178,180,184,
%U A031443 195,197,198,201,202,204,209,210,212,216,225,226,228,232,240
%N A031443 Digitally balanced numbers: numbers which in base 2 have the same number
of 0's as 1's.
%C A031443 Also numbers n such that the binary digital mean dm(2, n) = sigma(i in
[1, d]: d_i * 2 - 1) / (2 * d) = 0, where d is the number of digits
in the binary representation of n and d_i the individual digits.
[From Reikku Kulon (reikku(AT)gmail.com), Sep 21 2008]
%C A031443 Contribution from Reikku Kulon (reikku(AT)gmail.com), Sep 29 2008: (Start)
%C A031443 Each run of values begins with 2^(2k + 1) + 2^(k + 1) - 2^k - 1. The
initial values increase according to the sequence {2^(k - 1), 2^(k
- 2), 2^(k - 3), ..., 2^(k - k)}.
%C A031443 After this, the values follow a periodic sequence of increases by successive
powers of two with single odd values interspersed.
%C A031443 Each run ends with an odd increase followed by increases of {2^(k - k),
..., 2^(k - 2), 2^(k - 1), 2^k}, finally reaching 2^(2k + 2) - 2^(k
+ 1).
%C A031443 Similar behavior occurs in other bases. (End)
%C A031443 Numbers n such that A000120(n)/A031443(n) = 1/2. [From Ctibor O. Zizka
(c.zizka(AT)email.cz), Oct 15 2008]
%H A031443 Reikku Kulon, <a href="b031443.txt">Table of n, a(n) for n in [1, 10000]</
a>
%F A031443 a(n+1)=a(n)+2^k+2^(m-1)-1+int((2^(k+m)-2^k)/a(n))*(2^(2*m)+2^(m-1)) where
k is the largest integer such that 2^k divides a(n) and m is the
largest integer such that 2^m divides a(n)/2^k+1 - Ulrich Schimke
(UlrSchimke(AT)aol.com)
%F A031443 A145037(a(n)) equals zero. [From Reikku Kulon (reikku(AT)gmail.com),
Oct 02 2008]
%e A031443 9 is present because '1001' contains 2 '0's and 2 '1's
%p A031443 (Maple) a:=proc(n) local nn, n1, n0: nn:=convert(n,base,2): n1:=add(nn[i],
i=1..nops(nn)): n0:=nops(nn)-n1: if n0=n1 then n else end if end
proc: seq(a(n), n= 1.. 240); [From Emeric Deutsch (deutsch(AT)duke.poly.edu),
Jul 31 2008]
%t A031443 f0[n_]:=DigitCount[n,2,0]; f1[n_]:=DigitCount[n,2,1]; f[n_]:=f1[n]/f0[n];
lst={};Do[If[f[n]==1,AppendTo[lst,n]],{n,6!}];lst [From Vladimir
Orlovsky (4vladimir(AT)gmail.com), Jul 21 2009]
%o A031443 (C) int recursive (int n) {int nWork, result, k, m; for (nWork=n,k=0;
nWork%2==0; k++,nWork/=2); nWork++; for (m=0; nWork%2==0; m++,nWork/
=2); result=n+pow(2,k)+pow(2,m-1)-1; result+=(int)((pow(2,k+m)-pow(2,
k))/n) * (pow(2,2*m)+pow(2,m-1)); return (result); }
%o A031443 (PARI) for(n=1,100,b=binary(n); l=length(b); if(sum(i=1,l, component(b,
i))==l/2,print1(n,",")))
%Y A031443 Cf. A049354-A049360. See also A061854, A037861. Terms of binary width
n are enumerated by A001700.
%Y A031443 Cf. A144777, A144798, A144799, A144800, A144801, A144812 (subsets).
%Y A031443 Cf. A000120, A001316, A006519, A145057, A145058, A145059, A145060, A144912,
A145037.
%Y A031443 Sequence in context: A135782 A037457 A037314 this_sequence A051017 A078180
A058890
%Y A031443 Adjacent sequences: A031440 A031441 A031442 this_sequence A031444 A031445
A031446
%K A031443 nonn,base,easy,nice
%O A031443 1,1
%A A031443 Clark Kimberling (ck6(AT)evansville.edu)
|