|
|
A165265
|
|
Concatenate the number of 1's and number of 0's in the binary expansion of n.
|
|
1
|
|
|
1, 10, 11, 20, 12, 21, 21, 30, 13, 22, 22, 31, 22, 31, 31, 40, 14, 23, 23, 32, 23, 32, 32, 41, 23, 32, 32, 41, 32, 41, 41, 50, 15, 24, 24, 33, 24, 33, 33, 42, 24, 33, 33, 42, 33, 42, 42, 51, 24, 33, 33, 42, 33, 42, 42, 51, 33, 42, 42, 51, 42, 51, 51, 60, 16, 25, 25, 34, 25, 34
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(7) = 30 because "111" has three 0's and zero 1's.
a(8) = 13 because "1000" has one 1 and three 0's.
a(1023) = 100 because "1111111111" has no 0's and ten 1's.
a(2048) = 111 because "100000000000" has eleven 0's and one 1. (End)
|
|
MATHEMATICA
|
f[n_]:=Module[{idn2=IntegerDigits[n, 2]}, FromDigits[Join[{Count[idn2, 1], Count[idn2, 0]}]]]
Table[FromDigits@ Flatten@ Map[IntegerDigits, DigitCount[n, 2]], {n, 0, 73}] (* Michael De Vlieger, Sep 23 2017 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn,less
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|