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.

This page as a plain text file.
%I A139122 #15 Jun 15 2022 13:22:36
%S A139122 2,37,599,153437,628479869
%N 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.
%C A139122 Primes in A139102.
%C A139122 a(6) > 10^14632 if it exists (no further primes in first 5000 terms of A139102). - _Michael S. Branicky_, Jan 25 2022
%t A139122 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 *)
%t A139122 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 *)
%o A139122 (PARI) f(n) = fromdigits(vector(prime(n)-1, k, !isprime(k)), 2); \\ A139102
%o A139122 lista(nn) = for (n=1, nn, if (isprime(p=f(n)), print1(p, ", ")));
%o A139122 (Python) # uses agen() in A139102
%o A139122 from sympy import isprime
%o A139122 print(list(islice(filter(isprime, agen()), 5))) # _Michael S. Branicky_, Jan 25 2022
%Y A139122 Cf. A118255, A118256, A118257, A139101, A139102, A139103, A139104, A139119, A139120.
%K A139122 nonn,base,more
%O A139122 1,1
%A A139122 _Omar E. Pol_, Apr 11 2008
%E A139122 a(5) from _Robert Price_, Apr 03 2019