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 A139104 #24 Aug 28 2019 09:53:59 %S A139104 2,4,18,74,1198,4794,76718,306874,4909998,314239934,1256959738, %T A139104 80445423294,1287126772718,5148507090874,82376113453998, %U A139104 5272071261055934,337412560707579838,1349650242830319354,86377615541140438718,1382041848658247019502,5528167394632988078010 %N A139104 Numbers whose binary representation shows the distribution of prime numbers up to the n-th prime, using "0" for primes and "1" for nonprime numbers. %C A139104 a(n) is the decimal representation of A139103(n) interpreted as binary number. %H A139104 Harvey P. Dale, <a href="/A139104/b139104.txt">Table of n, a(n) for n = 1..467</a> %H A139104 Omar E. Pol, <a href="http://polprimos.com">Determinacion geometrica de los numeros primos y perfectos</a>. %F A139104 a(n) = 2 * A139102(n). %F A139104 From _Ridouane Oudra_, Aug 27 2019: (Start) %F A139104 a(n) = 2^prime(n) - 1 - (1/2)*(n + Sum_{i=1..prime(n)} 2^(prime(n)-i)*pi(i)), where prime(n) = A000040(n) and pi(n) = A000720(n) %F A139104 a(n) = A001348(n) - A121240(n) %F A139104 a(n) = A118255(A000040(n)). (End) %e A139104 a(4)=74 because 74 written in base 2 is 1001010 and the string "1001010" shows the distribution of prime numbers up to the 4th prime, using "0" for primes and "1" for nonprime numbers. %t A139104 Table[ sum = 0; For[i = 1, i <= Prime[n] , i++, sum = sum*2; %t A139104 If[! PrimeQ[i], sum++]]; sum, {n, 1, 21}] (* _Robert Price_, Apr 03 2019 *) %t A139104 Module[{nn=30,t},t=Table[If[PrimeQ[n],0,1],{n,Prime[nn]}];Table[ FromDigits[ Take[t,p],2],{p,Prime[Range[nn]]}]] (* _Harvey P. Dale_, Jul 15 2019 *) %o A139104 (PARI) a(n) = fromdigits(vector(prime(n), k, !isprime(k)), 2); \\ _Michel Marcus_, Apr 04 2019 %Y A139104 Subset of A118255. %Y A139104 Cf. A000040, A018252, A139101, A139102, A139103, A139119, A139120, A139122, A000720, A001348, A121240. %K A139104 nonn %O A139104 1,1 %A A139104 _Omar E. Pol_, Apr 08 2008 %E A139104 More terms from _R. J. Mathar_, May 22 2008 %E A139104 a(19)-a(21) from _Robert Price_, Apr 03 2019