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.

A253051 A compressed version of A253050 (A252867 mod 2): replace every substring 01 in A253050 with 1, every 001 with 2, every 0001 with 3, every 00001 with 4, etc.

This page as a plain text file.
%I A253051 #21 Mar 04 2025 11:47:34
%S A253051 1,1,2,1,1,2,1,2,1,2,1,3,1,1,1,2,2,2,1,1,1,1,1,1,2,1,2,1,1,1,1,2,1,1,
%T A253051 1,1,1,1,1,3,1,1,1,2,1,2,2,2,1,1,2,1,2,1,1,2,1,1,1,2,1,2,1,1,1,1,1,1,
%U A253051 1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,3,1,1,2,2,1,1,2,1,1,1,2,2,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,2,1
%N A253051 A compressed version of A253050 (A252867 mod 2): replace every substring 01 in A253050 with 1, every 001 with 2, every 0001 with 3, every 00001 with 4, etc.
%C A253051 The replacements are to be done in reverse order, of course, starting with the longest string of 0 and working backwards.
%C A253051 The first 4 appears at about term 3879. When does the first 5 appear?
%C A253051 Equivalent to run lengths of 0's. - _Chai Wah Wu_, Jan 01 2015
%C A253051 a(n) < 5 for n <= 10^6. - _Chai Wah Wu_, Jan 14 2015
%H A253051 Chai Wah Wu, <a href="/A253051/b253051.txt">Table of n, a(n) for n = 0..10000</a>
%o A253051 (Python)
%o A253051 A253051_list, c, l1, l2, s, b = [1], 1, 2, 1, 3, set()
%o A253051 for _ in range(10**6):
%o A253051     i = s
%o A253051     while True:
%o A253051         if not (i in b or i & l1) and i & l2:
%o A253051             if i & 1:
%o A253051                 A253051_list.append(c)
%o A253051                 c = 0
%o A253051             else:
%o A253051                 c += 1
%o A253051             l2, l1 = l1, i
%o A253051             b.add(i)
%o A253051             while s in b:
%o A253051                 b.remove(s)
%o A253051                 s += 1
%o A253051             break
%o A253051         i += 1 # _Chai Wah Wu_, Jan 01 2015
%Y A253051 Cf. A252867, A253050.
%K A253051 nonn
%O A253051 0,3
%A A253051 _N. J. A. Sloane_, Jan 01 2015