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 A118256 #28 Jan 10 2022 08:31:57 %S A118256 1,10,100,1001,10010,100101,1001010,10010101,100101011,1001010111, %T A118256 10010101110,100101011101,1001010111010,10010101110101, %U A118256 100101011101011,1001010111010111,10010101110101110,100101011101011101,1001010111010111010,10010101110101110101,100101011101011101011 %N A118256 Concatenation for i=1 to n of A005171(i); also A118255 in base 2. %H A118256 Michael S. Branicky, <a href="/A118256/b118256.txt">Table of n, a(n) for n = 1..1000</a> (terms 1..30 from N. J. A. Sloane) %F A118256 a(n) ~ 10^n * 0.10010101.... [_Charles R Greathouse IV_, Dec 27 2011] %e A118256 A005171 : 1,0,0,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,1,1,0,1,1 ................ %e A118256 a(1)=1, a(2)=10, a(3)=100, a(4)=1001, ... %t A118256 Array[FromDigits@ Array[Boole[! PrimeQ@ #] &, #] &, 21] (* or *) %t A118256 FromDigits@ IntegerDigits[#, 2] & /@ Last@ Transpose@ NestList[{#1 + 1, If[PrimeQ[#1 + 1], 2 #2, 2 #2 + 1]} & @@ # &, {1, 1}, 21] (* _Michael De Vlieger_, Nov 01 2016, latter after _Harvey P. Dale_ at A118255 *) %o A118256 (PARI) a(n) = sum(k=1, n, !isprime(k)*10^(n-k)); \\ _Michel Marcus_, Nov 01 2016 %o A118256 (Python) %o A118256 from sympy import isprime %o A118256 def a(n): return int("".join(str(1-isprime(i)) for i in range(1, n+1))) %o A118256 print([a(n) for n in range(1, 22)]) # _Michael S. Branicky_, Jan 10 2022 %o A118256 (Python) # faster version for initial segment of sequence %o A118256 from sympy import isprime %o A118256 from itertools import count, islice %o A118256 def agen(): # generator of terms %o A118256 an = 0 %o A118256 for k in count(1): %o A118256 an = 10 * an + int(not isprime(k)) %o A118256 yield an %o A118256 print(list(islice(agen(), 21))) # _Michael S. Branicky_, Jan 10 2022 %Y A118256 Cf. A005171, A118255, A118257. %K A118256 nonn,base,easy %O A118256 1,2 %A A118256 _Pierre CAMI_, Apr 19 2006 %E A118256 Corrected by _Omar E. Pol_, Nov 08 2007