|
|
A319953
|
|
List of binary words of lengths 0, 1, 2, etc., including empty word, each prefixed by a 2.
|
|
3
|
|
|
2, 20, 21, 200, 201, 210, 211, 2000, 2001, 2010, 2011, 2100, 2101, 2110, 2111, 20000, 20001, 20010, 20011, 20100, 20101, 20110, 20111, 21000, 21001, 21010, 21011, 21100, 21101, 21110, 21111, 200000, 200001, 200010, 200011, 200100, 200101, 200110, 200111
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(PARI) a(n) = my (b=binary(n+1)); b[1]++; fromdigits(b) \\ Rémy Sigrist, Oct 04 2018
(Python)
def a(n): return int(bin(n)[2:].replace('1', '2', 1))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|