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.

A213087 Concatenate the binary representations of the nonnegative integers and form successive terms by inserting a comma after each zero.

This page as a plain text file.
%I A213087 #9 Jun 30 2012 08:14:57
%S A213087 0,110,1110,0,10,1110,11110,0,0,10,0,110,10,10,11110,0,110,11110,
%T A213087 111110,0,0,0,10,0,0,110,0,10,10,0,1110,10,0,10,10,110,110,10,111110,
%U A213087 0,0,110,0,1110,10,110,111110,0,1110,111110,1111110,0,0,0,0,10,0,0
%N A213087 Concatenate the binary representations of the nonnegative integers and form successive terms by inserting a comma after each zero.
%C A213087 This sequence has the same property as A209355, namely, each term in this sequence occurs infinitely often in runs of every finite length >= 1. This sequence, however, contains an infinite number of distinct terms, the same digit strings as occur uniquely and sorted in A105279.
%H A213087 Rick L. Shepherd, <a href="/A213087/b213087.txt">Table of n, a(n) for n = 1..100000</a>
%e A213087 The binary representations of 0, 1, 2, 3, 4 are 0, 1, 10, 11, 100, so concatenation gives 011011100, which, when commas are inserted after each zero, produces 0, 110, 1110, 0, terms a(1) through a(4).
%o A213087 (PARI)
%o A213087 /* Calculate terms_wanted terms starting with n: Binary values*/
%o A213087 /* of n, n + 1, n + 2, ..., are concatenated and each term is */
%o A213087 /* the string of all bits up to and including the next zero.  */
%o A213087 /* (Note: Behavior of PARI binary function is such that if    */
%o A213087 /* n < 0 is used, binary values of |n|, |n+1|, |n+2|, ...,    */
%o A213087 /* are concatenated here.)                                    */
%o A213087 /*                                                            */
%o A213087 {a(n, terms_wanted) =
%o A213087 local(v = vector(terms_wanted), term = 0, s = "", b, m, p);
%o A213087 while(term<terms_wanted,
%o A213087   b = binary(n);
%o A213087   m = matsize(b)[2];
%o A213087   p = 1;
%o A213087   while(p<=m && term<terms_wanted,
%o A213087     s = concat(s,Str(b[p]));
%o A213087     if(b[p]==0,
%o A213087       term++;
%o A213087       v[term] = eval(s);
%o A213087       s = "";
%o A213087     );
%o A213087     p++;
%o A213087   );
%o A213087   n++;
%o A213087 ); return(v)}
%o A213087 A213087 = a(0, 100000);
%o A213087 for(n=1, 100000, write("b213087.txt", n, " ", A213087[n]))
%o A213087 (Haskell)
%o A213087 a213087 n = a213087_list !! (n-1)
%o A213087 a213087_list = f a030190_list where
%o A213087    f xs = foldl1 (\v d -> 10 * v + d) (ys ++ [0]) : f zs where
%o A213087           (ys, _:zs) = span (/= 0) xs
%o A213087 -- _Reinhard Zumkeller_, Jun 30 2012
%Y A213087 Cf. A209355, A105279, A007088.
%Y A213087 Cf. A030190.
%K A213087 nonn,base,easy
%O A213087 1,2
%A A213087 _Rick L. Shepherd_, Jun 07 2012