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

A095078 Primes with a single 0 bit in their binary expansion.

Original entry on oeis.org

2, 5, 11, 13, 23, 29, 47, 59, 61, 191, 223, 239, 251, 383, 479, 503, 509, 991, 1019, 1021, 2039, 3583, 3967, 4079, 4091, 4093, 6143, 15359, 16127, 16319, 16381, 63487, 65407, 65519, 129023, 131063, 245759, 253951, 261631, 261887, 262079
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

Except for the first value 2, the sequence gives the primes of the form 2^k -2^j -1 with 0 < j < k-1. If j=k-1 we obtain the Mersenne primes. - Pierre CAMI, May 19 2005
{2} UNION (A000040 INTERSECT A190620). - Chai Wah Wu, Dec 19 2024

Crossrefs

Intersection of A000040 and A030130. Cf. A095058, A190620.

Programs

  • Mathematica
    Select[Prime[Range[23000]],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Nov 28 2019 *)
  • PARI
    forprime(p=2,262079,v=binary(p);s=0;for(k=1,#v,s+=v[k]);if(#v-s==1,print1(p,", "))) \\ Washington Bomfim, Jan 13 2011

A138290 Numbers m such that 2^(m+1) - 2^k - 1 is composite for all 0 <= k < m.

Original entry on oeis.org

6, 14, 22, 26, 30, 36, 38, 42, 54, 57, 62, 70, 78, 81, 90, 94, 110, 122, 126, 132, 134, 138, 142, 147, 150, 158, 166, 168, 171, 172, 174, 178, 182, 190, 194, 198, 206, 210, 222, 238, 254, 285, 294, 312, 315, 318, 334, 336, 350, 366, 372, 382, 405, 414, 416, 432
Offset: 1

Views

Author

T. D. Noe, Mar 13 2008

Keywords

Comments

The binary representation of 2^(m+1) - 2^k - 1 has m 1-bits and one 0-bit. Note that prime m are very rare: 577 is the first and 5569 is the second.
A208083(a(n)+1) = 0 (cf. A081118). - Reinhard Zumkeller, Feb 23 2012 [Corrected by Thomas Ordowski, Feb 19 2024]
Conjecture: 2^j - 2 are terms for j > 2. - Chai Wah Wu, Sep 07 2021
The proof of this conjecture is in A369375. - Thomas Ordowski, Mar 20 2024

Examples

			6 is here because 95, 111, 119, 123, 125 and 126 are all composite.
		

Crossrefs

Many common terms with A092112.

Programs

  • Haskell
    import Data.List (elemIndices)
    a138290 n = a138290_list !! (n-1)
    a138290_list = map (+ 1) $ tail $ elemIndices 0 a208083_list
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Mathematica
    t={}; Do[num=2^(n+1)-1; k=0; While[kHarvey P. Dale, Apr 09 2022 *)
  • PARI
    isok(m) = my(nb=0); for (k=0, m-1, if (!ispseudoprime(2^(m+1) - 2^k - 1), nb++, break)); nb==m; \\ Michel Marcus, Sep 13 2021
  • Python
    from sympy import isprime
    A138290_list = []
    for n in range(1,10**3):
        k2, n2 = 1, 2**(n+1)
        for k in range(n):
            if isprime(n2-k2-1):
                    break
            k2 *= 2
        else:
            A138290_list.append(n) # Chai Wah Wu, Sep 07 2021
    

Formula

For these m, A095058(m) = 0 and A110700(m) > 1.
For n > 0, a(n) = A369375(n+1) - 1. - Thomas Ordowski, Mar 20 2024

A095059 Number of primes with two 0-bits (A095079) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 1, 2, 4, 0, 9, 5, 14, 4, 16, 9, 18, 0, 21, 21, 21, 7, 41, 22, 31, 5, 37, 20, 33, 14, 37, 45, 47, 0, 69, 31, 36, 34, 55, 34, 71, 10, 60, 50, 69, 22, 81, 52, 59, 5, 97, 71, 79, 42, 67, 86, 95, 13, 103, 61, 81, 47, 98, 50, 110, 0, 108, 87, 116, 36, 125, 98, 98, 29, 126, 90, 125, 46, 107, 100, 125, 8, 158, 81, 109, 65, 156, 94, 131, 27, 127, 144, 146, 38, 167, 129, 137, 6, 127, 112, 178, 76
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import combinations, count, islice
    def a(n): # generator of terms
        if n < 2: return 0
        b, d = (1<Michael S. Branicky, Dec 27 2023

Extensions

Added terms a(34)-a(99) from the Wagstaff paper. - N. J. A. Sloane, Jun 19 2011

A272143 For a given n, and any m less than n-1, the total number of primes of the form 2^n-2^m-1.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 0, 4, 4, 3, 1, 5, 1, 4, 0, 3, 2, 8, 1, 11, 4, 5, 0, 7, 1, 2, 0, 1, 5, 4, 0, 7, 5, 1, 1, 9, 0, 6, 0, 7, 1, 6, 0, 4, 7, 2, 1, 10, 3, 3, 1, 2, 1, 6, 0, 4, 3, 0, 1, 8, 3, 3, 0, 3, 1, 8, 1, 2, 2, 3, 0, 9, 1, 5, 2, 5, 8, 3, 0, 10
Offset: 1

Views

Author

Hans Havermann, Apr 21 2016

Keywords

Comments

For the first 12000 terms the average is ~3.8 with a maximum of 25 at a(11520).
Essentially the same as A095058. - R. J. Mathar, Apr 24 2016

Examples

			For n=1, m<0, so there are no solutions. For n=2 there is one solution: m=0, yielding prime 2. For n=3, one solution: m=1, yielding prime 5. For n=4 there are two solutions: m=2 and m=1, yielding primes 11 and 13 respectively. The primes so formed are terms of A095078.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Table[2^n - 2^m - 1, {m, 0, n - 2}], PrimeQ[#] & ]], {n, 1, 100}] (* Robert Price, Apr 21 2016 *)
  • Python
    from sympy import isprime
    def a(n): return sum(1 for i in range(n-1) if isprime(2**n-1-2**i))
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Nov 09 2023

A368214 Primes with a single 0-bit in binary expansion such that changing the position of the 0-bit always gives a nonprime (including the one with a leading zero).

Original entry on oeis.org

2, 2039, 6143, 522239, 33546239, 260046847, 16911433727, 32212254719, 2196875771903, 140735340871679, 2251799813685119, 9005000231485439, 576460752169205759, 36893488147410714623, 147573811852188057599, 9444732965739282038783, 154742504910672534362390399
Offset: 1

Views

Author

Ya-Ping Lu, Dec 23 2023

Keywords

Comments

It seems that most of the terms end with '9', followed by those ending with '3', '7', and '1'.

Examples

			2 is a term because 2 is a prime with one '0' in binary form ('10') and '01' is not a prime. 2039 is a term because 2039 is a prime with one '0' in binary form ('11111110111') and changing the position of the '0', for example, '11111111011' = 2043 and '01111111111' = 1023, always results in a composite.
		

Crossrefs

Subsequence of A095078.

Programs

  • Python
    from sympy import isprime
    for n in range(1,100):
        s = n*'1'; c = 0
        for j in range(n+1):
            num = int(s[:j]+'0'+s[j:], 2)
            if isprime(num):
                c += 1
                if c == 1: r = num
                if c == 2: break
        if c == 1: print(r, end = ', ')
Showing 1-5 of 5 results.