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!)
A171823 a(n) = base-2 concatenation XYZ, where X = number of bits in binary expansion of n, Y = number of 0's, Z = number of 1's. 2

%I #5 Oct 20 2016 03:47:53

%S 101,1011,10010,11101,11110,11110,11011,100111,1001010,1001010,100111,

%T 1001010,100111,100111,1000100,1011001,1011110,1011110,1011011,

%U 1011110,1011011,1011011,1011100,1011110,1011011,1011011,1011100,1011011,1011100,1011100

%N a(n) = base-2 concatenation XYZ, where X = number of bits in binary expansion of n, Y = number of 0's, Z = number of 1's.

%e 14 = 1110 in base 2, so X = 4 = 100, Y = 1, Z = 3 = 11, a(14) = 100.1.11 = 100111.

%p F:=proc(n) local t1,t2,t2b,n1,n1b,n0,n0b,t3,t4;

%p t1:=convert(n,base,2);

%p t2:=nops(t1);

%p t2b:=convert(t2,base,2);

%p n1:=add(t1[i],i=1..t2);

%p n1b:=convert(n1,base,2);

%p n0:=t2-n1;

%p n0b:=convert(n0,base,2);

%p t3:=[

%p seq(t2b[nops(t2b)+1-i],i=1..nops(t2b)),

%p seq(n0b[nops(n0b)+1-i],i=1..nops(n0b)),

%p seq(n1b[nops(n1b)+1-i],i=1..nops(n1b))

%p ];

%p t4:="";

%p for i from 1 to nops(t3) do t4:=cat(t4,t3[i]); od:

%p parse(t4);

%p end;

%t a[n_] := IntegerDigits[{z, y} = DigitCount[n, 2]; {y+z, y, z}, 2] // Flatten // FromDigits; Array[a, 30] (* _Jean-François Alcover_, Oct 20 2016 *)

%Y Cf. A171825, A171798, A171813.

%K nonn,base

%O 1,1

%A _N. J. A. Sloane_, Oct 16 2010

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 19 10:38 EDT 2024. Contains 371791 sequences. (Running on oeis4.)