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 A139101 #25 Jan 10 2022 06:52:08 %S A139101 1,10,1001,100101,1001010111,100101011101,1001010111010111, %T A139101 100101011101011101,1001010111010111010111, %U A139101 1001010111010111010111011111,100101011101011101011101111101,100101011101011101011101111101011111,1001010111010111010111011111010111110111 %N A139101 Numbers that show the distribution of prime numbers up to the n-th prime minus 1, using "0" for primes and "1" for nonprime numbers. %C A139101 a(n) has A000040(n)-1 digits, n-1 digits "0" and A000040(n)-n digits "1". %H A139101 Michael S. Branicky, <a href="/A139101/b139101.txt">Table of n, a(n) for n = 1..168</a> %H A139101 Omar E. Pol, <a href="http://polprimos.com">Determinacion geometrica de los numeros primos y perfectos</a>. %t A139101 Table[ sum = 0; For[i = 1, i <= Prime[n] - 1 , i++, sum = sum*2; %t A139101 If[! PrimeQ[i], sum++]]; IntegerString[sum, 2], {n, 1, 13}] (* _Robert Price_, Apr 03 2019 *) %o A139101 (PARI) a(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 10); \\ _Michel Marcus_, Apr 04 2019 %o A139101 (Python) %o A139101 from sympy import isprime, prime %o A139101 def a(n): return int("".join(str(1-isprime(i)) for i in range(1, prime(n)))) %o A139101 print([a(n) for n in range(1, 14)]) # _Michael S. Branicky_, Jan 10 2022 %o A139101 (Python) # faster version for initial segment of sequence %o A139101 from sympy import isprime %o A139101 from itertools import count, islice %o A139101 def agen(): # generator of terms %o A139101 an = 0 %o A139101 for k in count(1): %o A139101 an = 10 * an + int(not isprime(k)) %o A139101 if isprime(k+1): %o A139101 yield an %o A139101 print(list(islice(agen(), 13))) # _Michael S. Branicky_, Jan 10 2022 %Y A139101 Binary representation of A139102. %Y A139101 Subset of A118256. %Y A139101 Cf. A000040, A018252, A139103, A139104, A139119, A139120, A139122. %K A139101 nonn,base %O A139101 1,2 %A A139101 _Omar E. Pol_, Apr 08 2008