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.

Showing 1-4 of 4 results.

A178350 Semiprimes with both a prime number of 0's and a prime number of 1's in their binary representations.

Original entry on oeis.org

9, 10, 21, 22, 25, 26, 35, 38, 49, 65, 87, 91, 93, 94, 115, 118, 121, 122, 133, 134, 143, 145, 146, 155, 158, 161, 185, 194, 203, 205, 206, 213, 214, 217, 218, 319, 381, 382, 415, 445, 446, 471, 478, 493, 501, 502, 505, 515, 517, 527, 529, 535, 542, 545, 551
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 25 2010

Keywords

Examples

			a(1)=9 because 9(written in base 10)=1001 where 2=prime number of 0's and 2=prime number of 1's.
		

Crossrefs

Programs

  • Maple
    A000120 := proc(n) add(d,d=convert(n,base,2)) ; end proc:
    A080791 := proc(n) dgs :=convert(n,base,2) ; nops(dgs)-A000120(n) ; end proc:
    for n from 1 to 300 do spr :=A001358(n) ; if isprime( A080791(spr) ) and isprime(A000120(spr)) then printf("%d,",spr) ; end if; end do: # R. J. Mathar, Aug 12 2010
  • Mathematica
    Select[Range[600],PrimeOmega[#]==2&&AllTrue[{DigitCount[ #,2,0], DigitCount[ #,2,1]},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 25 2016 *)

Extensions

Corrected (167 removed) by R. J. Mathar, Aug 12 2010

A144213 Primes with a prime number of 0's in their binary representations.

Original entry on oeis.org

17, 19, 37, 41, 43, 53, 71, 79, 83, 89, 101, 103, 107, 109, 113, 131, 137, 151, 157, 167, 173, 179, 181, 193, 199, 211, 227, 229, 233, 241, 257, 263, 269, 277, 281, 293, 311, 317, 337, 347, 349, 353, 359, 367, 373, 379, 389, 401, 431, 439, 443, 449, 461, 463
Offset: 1

Views

Author

Leroy Quet, Sep 14 2008

Keywords

Examples

			41, a prime, in binary is 101001. This has three 0's and 3 is prime, so 41 is in the sequence.
		

Crossrefs

Cf. A081092, A144214. Intersection of A000040 and A144754.

Programs

  • Maple
    A080791 := proc(n) local i,dgs ; dgs := convert(n,base,2) ; nops(dgs)-add(i,i=dgs) ; end: isA144213 := proc(n) local no0 ; no0 := A080791(n) ; if isprime(n) and isprime(no0) then true ; else false; fi; end: for n from 1 to 1200 do if isA144213(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 17 2008
    # second Maple program:
    q:= n-> isprime(n) and isprime(add(1-i, i=Bits[Split](n))):
    select(q, [$1..500])[];  # Alois P. Heinz, Dec 27 2023
  • Mathematica
    nmax = 100;
    Select[Prime[Range[nmax]],
    PrimeQ[Total@Mod[1 + IntegerDigits[#, 2], 2]] &] (* Andres Cicuttin, Jul 08 2020 *)
    Select[Prime[Range[100]],PrimeQ[DigitCount[#,2,0]]&] (* Harvey P. Dale, Feb 03 2021 *)
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_length()-n.bit_count()) and isprime(n)
    print([k for k in range(464) if ok(k)]) # Michael S. Branicky, Dec 27 2023

Extensions

More terms from R. J. Mathar, Sep 17 2008

A169817 n-th prime with both a prime number of 0's and a prime number of 1's in binary representation minus n-th semiprime with both a prime number of 0's and a prime number of 1's in their binary representation.

Original entry on oeis.org

8, 9, 16, 19, 54, 77, 72, 71, 82, 72, 64, 66, 74, 79, 64, 63, 72, 77, 78, 93, 86, 88, 95, 102, 209, 218, 246, 245, 240, 258, 281, 278, 285, 304, 323, 238, 182, 187, 162, 142, 155, 136, 135, 124, 130, 139, 142, 138, 142, 134, 148, 166, 167, 174, 176, 168, 177, 174
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 25 2010

Keywords

Examples

			a(1)=A144214(1)-A178350(1)=17-9=8.
		

Crossrefs

Programs

  • Mathematica
    pn0Q[n_]:=PrimeQ[DigitCount[n,2,1]]&&PrimeQ[DigitCount[n,2,0]]; nn=600;Module[{ps=Select[Prime[Range[nn]],pn0Q],sps=Select[Range[nn], PrimeOmega[#]==2&&pn0Q[#]&],minlen},minlen=Min[Length[ps], Length[ sps]];First[#]-Last[#]&/@Thread[{Take[ps,minlen],Take[sps,minlen]}]] (* Harvey P. Dale, May 07 2012 *)

Formula

a(n)=A144214(n)-A178350(n).

Extensions

Corrected (96 replaced by 86, all numbers from a(27) on replaced) by R. J. Mathar, Jun 04 2010

A173347 Fibonacci numbers with both a prime number of 0's and a prime number of 1's in their binary representations.

Original entry on oeis.org

21, 233, 196418, 9227465, 165580141, 2971215073, 53316291173, 2504730781961, 3416454622906707, 51680708854858323072, 184551825793033096366333, 898923707008479989274290850145, 3210056809456107725247980776292056
Offset: 1

Views

Author

Keywords

Comments

21 -> 10101, 233 -> 11101001, 196418 -> 101111111101000010,..

Crossrefs

Programs

  • Mathematica
    Select[Fibonacci[Range[6! ]],PrimeQ[DigitCount[ #,2,0]]&&PrimeQ[DigitCount[ #,2,1]]&]
Showing 1-4 of 4 results.