cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A038585 Write n in binary, delete 0's.

This page as a plain text file.
%I A038585 #28 May 19 2020 13:08:41
%S A038585 1,1,11,1,11,11,111,1,11,11,111,11,111,111,1111,1,11,11,111,11,111,
%T A038585 111,1111,11,111,111,1111,111,1111,1111,11111,1,11,11,111,11,111,111,
%U A038585 1111,11,111,111,1111,111,1111,1111,11111,11,111,111,1111,111,1111,1111
%N A038585 Write n in binary, delete 0's.
%H A038585 Vincenzo Librandi, <a href="/A038585/b038585.txt">Table of n, a(n) for n = 1..1000</a>
%H A038585 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A038585 a(n) = (9 * n mod 2 + 1) * a(floor(n/2)) + n mod 2. - _Reinhard Zumkeller_, Oct 10 2012
%F A038585 a(n) = A002275(A000120(n)). - _Chai Wah Wu_, May 19 2020
%t A038585 Table[FromDigits[DeleteCases[IntegerDigits[n,2],_?(#==0&)]],{n,60}] (* _Harvey P. Dale_, Feb 27 2012 *)
%t A038585 FromDigits/@(IntegerDigits[Range[60],2]/.(0->Nothing)) (* _Harvey P. Dale_, Apr 09 2017 *)
%o A038585 (Haskell)
%o A038585 a038585 0 = 0
%o A038585 a038585 n = (9 * m + 1) * (a038585 n') + m where (n', m) = divMod n 2
%o A038585 -- _Reinhard Zumkeller_, Oct 10 2012
%o A038585 (Python)
%o A038585 def A038585(n):
%o A038585     return int(bin(n)[2:].replace('0','')) # _Chai Wah Wu_, May 19 2020
%Y A038585 Cf. A000120, A002275, A038573.
%K A038585 nonn,easy,base,nice
%O A038585 1,3
%A A038585 _N. J. A. Sloane_
%E A038585 More terms from _Erich Friedman_