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.

A139122 Primes whose binary representation shows the distribution of prime numbers up to some prime minus 1, using "0" for primes and "1" for nonprime numbers.

Original entry on oeis.org

2, 37, 599, 153437, 628479869
Offset: 1

Views

Author

Omar E. Pol, Apr 11 2008

Keywords

Comments

Primes in A139102.
a(6) > 10^14632 if it exists (no further primes in first 5000 terms of A139102). - Michael S. Branicky, Jan 25 2022

Crossrefs

Programs

  • Mathematica
    Select[Table[ sum = 0; For[i = 1, i <= Prime[n] - 1 , i++, sum = sum*2; If[! PrimeQ[i], sum++]]; sum, {n, 1, 1000}], PrimeQ[#] &] (* Robert Price, Apr 03 2019 *)
    Module[{nn=500,p,x},p=Table[If[PrimeQ[n],0,1],{n,nn}];x=SequencePosition[p,{1,0}][[All,1]];Join[{2},Select[Table[FromDigits[Take[p,k],2],{k,x}],PrimeQ]]] (* Harvey P. Dale, Jun 15 2022 *)
  • PARI
    f(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 2); \\ A139102
    lista(nn) = for (n=1, nn, if (isprime(p=f(n)), print1(p, ", ")));
    
  • Python
    # uses agen() in A139102
    from sympy import isprime
    print(list(islice(filter(isprime, agen()), 5))) # Michael S. Branicky, Jan 25 2022

Extensions

a(5) from Robert Price, Apr 03 2019