|
|
A038585
|
|
Write n in binary, delete 0's.
|
|
3
|
|
|
1, 1, 11, 1, 11, 11, 111, 1, 11, 11, 111, 11, 111, 111, 1111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 11, 111, 111, 1111, 111, 1111, 1111
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
Table[FromDigits[DeleteCases[IntegerDigits[n, 2], _?(#==0&)]], {n, 60}] (* Harvey P. Dale, Feb 27 2012 *)
FromDigits/@(IntegerDigits[Range[60], 2]/.(0->Nothing)) (* Harvey P. Dale, Apr 09 2017 *)
|
|
PROG
|
(Haskell)
a038585 0 = 0
a038585 n = (9 * m + 1) * (a038585 n') + m where (n', m) = divMod n 2
(Python)
return int(bin(n)[2:].replace('0', '')) # Chai Wah Wu, May 19 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|