|
|
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
|
|
|
101, 1011, 10010, 11101, 11110, 11110, 11011, 100111, 1001010, 1001010, 100111, 1001010, 100111, 100111, 1000100, 1011001, 1011110, 1011110, 1011011, 1011110, 1011011, 1011011, 1011100, 1011110, 1011011, 1011011, 1011100, 1011011, 1011100, 1011100
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
14 = 1110 in base 2, so X = 4 = 100, Y = 1, Z = 3 = 11, a(14) = 100.1.11 = 100111.
|
|
MAPLE
|
F:=proc(n) local t1, t2, t2b, n1, n1b, n0, n0b, t3, t4;
t1:=convert(n, base, 2);
t2:=nops(t1);
t2b:=convert(t2, base, 2);
n1:=add(t1[i], i=1..t2);
n1b:=convert(n1, base, 2);
n0:=t2-n1;
n0b:=convert(n0, base, 2);
t3:=[
seq(t2b[nops(t2b)+1-i], i=1..nops(t2b)),
seq(n0b[nops(n0b)+1-i], i=1..nops(n0b)),
seq(n1b[nops(n1b)+1-i], i=1..nops(n1b))
];
t4:="";
for i from 1 to nops(t3) do t4:=cat(t4, t3[i]); od:
parse(t4);
end;
|
|
MATHEMATICA
|
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 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|