|
|
A256078
|
|
Write n in binary, exchange digits '0' <-> '1'.
|
|
10
|
|
|
1, 0, 1, 0, 11, 10, 1, 0, 111, 110, 101, 100, 11, 10, 1, 0, 1111, 1110, 1101, 1100, 1011, 1010, 1001, 1000, 111, 110, 101, 100, 11, 10, 1, 0, 11111, 11110, 11101, 11100, 11011, 11010, 11001, 11000, 10111, 10110, 10101, 10100, 10011, 10010, 10001, 10000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
|
|
LINKS
|
|
|
MATHEMATICA
|
Table[FromDigits[IntegerDigits[n, 2] /. {0 -> 1, 1 -> 0}], {n, 0, 47}] (* or *)
|
|
PROG
|
(PARI) A256078(n)=!n+eval(Strchr(apply(d->49-d, binary(n))))
(Python)
def a(n): return int(bin(1 if n==0 else n^((1 << n.bit_length())-1))[2:])
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|