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.
%I A382442 #6 Mar 28 2025 08:03:30 %S A382442 1,2,4,7,8,16,18,27,32,42,54,64,84,126,128,133,172,238,256,276,379, %T A382442 381,444,512,524,582,621,765,948,1024,1048,1179,1241,1449,1496,1557, %U A382442 1861,1896,1982,2048,2132,2155,2227,2386,2667,2900,3013,3058,3236,3444,3613 %N A382442 Lexicographically earliest sequence of positive integers such that for any n > 1, a(n) does not divide any of the positive numbers whose binary expansion appears as a contiguous subword in the concatenation of the previous terms. %C A382442 This sequence contains all powers of 2. %H A382442 Rémy Sigrist, <a href="/A382442/a382442.txt">C++ program</a> %e A382442 a(1) = 1. %e A382442 a(2) must not divide 1 ("1" in binary); we can take a(2) = 2. %e A382442 a(3) must not divide 1, 2, 3 or 6 ("1", "10", "11", "110" in binary); we can take a(3) = 4. %o A382442 (C++) // See Links section. %o A382442 (Python) %o A382442 from itertools import count, islice %o A382442 def agen(): # generator of terms %o A382442 an, s, d = 1, "1", {1} %o A382442 while True: %o A382442 yield an %o A382442 an = next(k for k in count(an+1) if not any(di%k == 0 for di in d)) %o A382442 for di in bin(an)[2:]: %o A382442 s += di %o A382442 d |= set(si for i in range(len(s)) if (si:=int(s[i:], 2)) > an) %o A382442 print(list(islice(agen(), 51))) # _Michael S. Branicky_, Mar 26 2025 %Y A382442 Cf. A382441 (decimal variant). %K A382442 nonn,base %O A382442 1,2 %A A382442 _Rémy Sigrist_, Mar 26 2025