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-3 of 3 results.

A093535 Duplicate of A081093.

Original entry on oeis.org

3, 7, 31, 127, 3583, 8191, 131071, 524287, 14680063, 1073479679, 2147483647
Offset: 1

Views

Author

Keywords

A081092 Primes having a prime number of 1's in their binary representation.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2003

Keywords

Comments

Same as primes with prime binary digit sum.
Primes with prime decimal digit sum are A046704.
Sum_{a(n) < x} 1/a(n) is asymptotic to log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 09 2012
A049084(A000120(a(n))) > 0; A081091, A000215 and A081093 are subsequences.

Examples

			15th prime = 47 = '101111' with five 1's, therefore 47 is in the sequence.
		

Crossrefs

Subsequence of A052294.

Programs

  • Haskell
    a081092 n = a081092_list !! (n-1)
    a081092_list = filter ((== 1) . a010051') a052294_list
    -- Reinhard Zumkeller, Nov 16 2012
    
  • Maple
    q:= n-> isprime(n) and isprime(add(i,i=Bits[Split](n))):
    select(q, [$1..500])[];  # Alois P. Heinz, Sep 28 2023
  • Mathematica
    Clear[BinSumOddQ];BinSumPrimeQ[a_]:=Module[{i,s=0},s=0;For[i=1,i<=Length[IntegerDigits[a,2]],s+=Extract[IntegerDigits[a,2],i];i++ ];PrimeQ[s]]; lst={};Do[p=Prime[n];If[BinSumPrimeQ[p],AppendTo[lst,p]],{n,4!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 06 2009 *)
    Select[Prime[Range[100]], PrimeQ[Apply[Plus, IntegerDigits[#, 2]]] &] (* Jonathan Sondow, Jun 09 2012 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprime(hammingweight(p)), print1(p, ", ")););} \\ Michel Marcus, Jan 16 2015
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_count()) and isprime(n)
    print([k for k in range(444) if ok(k)]) # Michael S. Branicky, Dec 27 2023

A102029 Smallest semiprime with Hamming weight n (i.e., smallest semiprime with exactly n ones when written in binary), or -1 if no such number exists.

Original entry on oeis.org

4, 6, 14, 15, 55, 95, 247, 447, 511, 1535, 2047, 7167, 12287, 32255, 49151, 98303, 196607, 393215, 983039, 1572863, 3145727, 6291455, 8388607, 33423359, 50331647, 117440511, 201326591, 528482303, 805306367, 1879048191, 3221225471
Offset: 1

Views

Author

Jonathan Vos Post, Jun 23 2007

Keywords

Comments

Semiprime analog of A061712. Extended by Stefan Steinerberger. Includes the subset Mersenne semiprimes A092561.

Examples

			a(1) = 4 because the first semiprime A001358(1) is 4 (base 10) which is written 100 in binary, the latter representation having exactly 1 one.
a(2) = 6 since A001358(2) = 6 = 110 (base 2) has exactly 2 ones.
a(4) = 15 since A001358(6) = 15 = 1111 (base 2) has exactly 4 ones and, as it also has no zeros, is the smallest of the Mersenne semiprimes.
		

Crossrefs

Programs

  • Mathematica
    Join[{4},Table[SelectFirst[Sort[FromDigits[#,2]&/@Permutations[ Join[ PadRight[{}, n,1],{0}]]],PrimeOmega[#]==2&],{n,2,40}]] (* Harvey P. Dale, Feb 06 2015 *)
Showing 1-3 of 3 results.