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

A081118 Triangle of first n numbers per row having exactly n 1's in binary representation.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 23, 27, 29, 31, 47, 55, 59, 61, 63, 95, 111, 119, 123, 125, 127, 191, 223, 239, 247, 251, 253, 255, 383, 447, 479, 495, 503, 507, 509, 511, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1023, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 06 2003

Keywords

Comments

T(n,n) = A036563(n+1) = 2^(n+1) - 3.
Numbers of the form 2^t - 2^k - 1, 1 <= k < t.

Examples

			Triangle begins:
.......... 1 ......... ................ 1
........ 3...5 ....... .............. 11 101
...... 7..11..13 ..... .......... 111 1011 1101
... 15..23..27..29 ... ...... 1111 10111 11011 11101
. 31..47..55..59..61 . . 11111 101111 110111 111011 111101.
		

Crossrefs

Programs

  • Haskell
    a081118 n k = a081118_tabl !! (n-1) !! (k-1)
    a081118_row n = a081118_tabl !! (n-1)
    a081118_tabl  = iterate
       (\row -> (map ((+ 1) . (* 2)) row) ++ [4 * (head row) + 1]) [1]
    a081118_list = concat a081118_tabl
    -- Reinhard Zumkeller, Feb 23 2012
  • Mathematica
    Table[2^(n+1)-2^(n-k+1)-1,{n,10},{k,n}]//Flatten (* Harvey P. Dale, Apr 09 2020 *)

Formula

T(n, k) = 2^(n+1) - 2^(n-k+1) - 1, 1<=k<=n.
a(n) = (2^A002260(n)-1)*2^A004736(n)-1; a(n)=(2^i-1)*2^j-1, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 04 2013

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

A181741 Primes of the form 2^t-2^k-1, k>=1.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Nov 08 2010

Keywords

Comments

All Mersenne primes A000668(i) are in the sequence, parametrized by t=A000043(i)+1 and k=A000043(i).
If p is in the sequence, then the exponents t and k are unique.
For given k, the smallest value of t defines sequence A181692.
Every term p=2^t-2^k-1 in this sequence here generates an entry 2^(t-1)*p in A181595 (cf. A181701).

Crossrefs

Cf. A010051, primes in A081118, see also A208083.

Programs

  • Haskell
    a181741 n = a181741_list !! (n-1)
    a181741_list = filter ((== 1) . a010051) a081118_list
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Maple
    isA000079 := proc(n) if n = 1 then true; elif type(n,'odd') then false; else if nops( numtheory[factorset](n) ) = 1 then  true;  else
    false; end if; end if; end proc:
    isA181741 := proc(p) if isprime(p) then k := A007814(p+1) ; (p+1)/2^k+1 ; return ( isA000079(%) and k >=1 ) ; else
    false;  end if; end proc:
    for i from 1 to 1000 do p := ithprime(i) ; if isA181741(p) then printf("%d,",p) ; end if; end do: # R. J. Mathar, Nov 18 2010
  • Mathematica
    Select[Table[2^t-2^k-1, {t, 1, 20}, {k, 1, t-1}] // Flatten // Union, PrimeQ] (* Jean-François Alcover, Nov 16 2017 *)
  • PARI
    lista(nn) = {for (n=3, nn, forstep(k=n-1, 1, -1, if (isprime(p=2^n-2^k-1), print1(p, ", "));););} \\ Michel Marcus, Dec 17 2018
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A181741_gen(): # generator of terms
        m = 2
        for t in count(1):
            r=1<>=1
            m<<=1
    A181741_list = list(islice(A181741_gen(),30)) # Chai Wah Wu, Jul 08 2022

Formula

Conjecture: equals the intersection of A000040 and A081118 or the intersection of A000040 and A089633. [R. J. Mathar, Nov 18 2010]

Extensions

Corrected (251 and 1019 inserted) and extended by R. J. Mathar, Nov 18 2010

A208091 Smallest number m such that exactly n primes of the form 2^m - 2^k - 1 exist, 1 <= k < m.

Original entry on oeis.org

1, 11, 3, 4, 6, 8, 38, 24, 32, 18, 48, 138, 20, 588, 144, 252, 5520, 168, 7200, 2400, 2850
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 23 2012

Keywords

Comments

A208083(a(n)) = n and A208083(m) <> n for m < a(n).
a(21) > 7600, if it exists. - Giovanni Resta, Jun 14 2018

Examples

			a(3) = 4 because for m = 4 there are exactly three primes of the given form: 13 = 2^4 - 2^1 - 1, 11 = 2^4 - 2^2 - 1, 7 = 2^4 - 2^3 - 1 and no smaller m satisfies this requirement.
		

Crossrefs

Cf. A208083.

Programs

  • Haskell
    import Data.List (elemIndices, elemIndex)
    import Data.Maybe (fromJust)
    a208091 = (+ 1) . fromJust . (`elemIndex` a208083_list)
    
  • Maple
    f:= n -> nops(select(k -> isprime(2^n-2^k-1), [$1..n-1])):
    for n from 1 to 300 do
    v:= f(n);
    if not assigned(A[v]) then A[v]:= n fi;
    od:
    seq(A[m],m=0..15); # Robert Israel, Jun 13 2018
  • Mathematica
    A = <||>; Do[c = Length@Select[Range[n-1], PrimeQ[2^n - 2^# - 1] &]; If[! KeyExistsQ[A, c], A[c]=n], {n, 140}]; Array[A, 13, 0] (* Giovanni Resta, Jun 13 2018 *)
  • PARI
    a(n) = {my(m=1); while(sum(k=1, m, isprime(2^m-2^k-1)) != n, m++); m;} \\ Michel Marcus, Jun 13 2018

Extensions

Corrected by Robert Israel, Jun 13 2018
a(17), a(19)-a(20) from Robert Israel, Jun 13 2018
a(16), a(18) from Giovanni Resta, Jun 14 2018

A369375 Numbers m such that the Mersenne number 2^m - 1 is a de Polignac number (A006285).

Original entry on oeis.org

1, 7, 15, 23, 27, 31, 37, 39, 43, 55, 58, 63, 71, 79, 82, 91, 95, 111, 123, 127, 133, 135, 139, 143, 148, 151, 159, 167, 169, 172, 173, 175, 179, 183, 191, 195, 199, 207, 211, 223, 239, 255, 286, 295, 313, 316, 319, 335, 337, 351, 367, 373, 383, 406, 415, 417, 433, 435, 447, 455, 461, 463, 479
Offset: 1

Views

Author

Thomas Ordowski, Jan 22 2024

Keywords

Comments

Integers m > 0 such that 2^m-1 - 2^n is not prime for every natural n < m.
For m > 2, a number m is a term of this sequence if and only if A208083(m) = 0.
All Mersenne number m = 2^k-1 for k > 2 are in this sequence. The proof is below.
Cf. A138290 (see Chai Wah Wu's conjecture in the third comment). By Crocker's (1971) theorem: if m > 2 and a <> b, then 2^(2^m)-1 - 2^a - 2^b is not prime.
If a = 2^m-1, then b < a, so for m > 2, 2^(2^m-1)-1 is a de Polignac number, QED.
Note that 2^(2^m-1)-1 - 2^n is divisible by some prime factor of 2^(2^m)-1.
Prime numbers of this sequence are Mersenne primes > 3, and many other primes.
Conjecture: if n > 5, then |2^(2^n-1)-1 - 2^m| is not prime for every m > 0.
If so, then by the dual Riesel conjecture, 2^(2^n-1)-1 is a (dual) Riesel number, i.e., if n > 5, then (2^(2^n-1)-1)2^m-1 is composite for every integer m > 0.
For example, the double Mersenne prime 2^(2^7-1)-1 may be a dual Riesel number.
It seems that the natural density of these numbers is about twice as high as the density of de Polignac numbers.
For many terms m, 2m+1 is also in this sequence. By iteration (x -> 2x+1), the subsequence b(n) = (m+1)2^n-1, for n >= 0, is infinite if m = 7 (which has already been proven) and probably if m = 27 (which is hard to prove).

Examples

			7 is a term since {2^7-1-2, 2^7-1-2^2, 2^7-1-2^3, 2^7-1-2^4, 2^7-1-2^5, 2^7-1-2^6} = {125, 123, 119, 111, 95, 63} and all six of these numbers are composite.
Note that both 2^148-1 and 2^148+1 are de Polignac numbers.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{k = n -1}, While[k > 1 && !PrimeQ[2^n -1 -2^k], k--]; k == 1]; Select[ Range[3, 450], fQ] (* Robert G. Wilson v, Jan 22 2024 *)

Formula

For n > 1, a(n) = A138290(n-1) + 1.
A208083(a(n)) = 0, for n > 0.

Extensions

More terms from Robert G. Wilson v, Jan 22 2024

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