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.

A181701 Near-perfect numbers (A181595) of the form 2^(t-1)*(2^t-2^k-1), where 2^t-2^k-1 is prime, k>=1, t>k.

Original entry on oeis.org

12, 20, 56, 88, 104, 368, 464, 992, 1504, 1888, 1952, 16256, 24448, 28544, 30592, 32128, 98048, 122624, 128768, 130304, 507392, 521728, 522752, 2087936, 7337984, 8124416, 8353792, 8378368, 8382464, 25161728, 67100672, 125820928, 132112384, 133685248, 134193152
Offset: 1

Views

Author

Vladimir Shevelev, Nov 06 2010

Keywords

Comments

There exist near-perfect numbers of the form 2^r*p, where p is prime, which are not in the sequence (e.g., 24,40,224). For given k, the smallest value of t gives sequence A181692.

Crossrefs

Programs

  • Mathematica
    s = Sort@ Flatten@ Table[p = (2^t - 2^k - 1); If[PrimeQ@ p, 2^(t - 1) p, Nothing], {t, 2, 14}, {k, t - 1}]; Select[Select[s, DivisorSigma[1, #] > 2 # &], MemberQ[Divisors@ #, DivisorSigma[1, #] - 2 #] &] (* Michael De Vlieger, Sep 23 2015, after Alonso del Arte at A181595 *)
  • PARI
    mx=2^269*(2^270-2^122-1); v=vector(1000); n=0; for(k=1, 269, for(t=k+1, 270, p=2^t-2^k-1; m=2^(t-1)*p; if(m>mx, next(2)); if(isprime(p), n++; v[n]=m))); v=vecsort(v); for(n=1, 1000, write("b181701.txt", n " " v[n])) /* Donovan Johnson, May 24 2013 */

Extensions

Edited, corrected, and extended by D. S. McNeil, Nov 18 2010

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

A331205 a(n) = least prime of the form 2^m - 2^n + 1.

Original entry on oeis.org

2, 3, 5, 549755813881, 17, 97, 193, 140737488355201, 257, 7681, 15361, 134215681, 12289, 8380417, 114689
Offset: 0

Views

Author

Hugo Pfoertner, Jan 12 2020

Keywords

Comments

a(15) = 2^447 - 2^15 + 1 is too large to be represented in the data.

Examples

			See A331204.
		

Crossrefs

Cf. A181692, A331204 (corresponding values of m).

Programs

  • PARI
    for(n=0,14, for(m=n+1,oo, k=2^m-2^n+1; if(isprime(k), print1(k,", "); break)))

A331204 Least m > n such that 2^m - 2^n + 1 is prime.

Original entry on oeis.org

1, 2, 3, 39, 5, 7, 8, 47, 9, 13, 14, 27, 14, 23, 17, 447, 17, 23, 20, 31, 23, 27, 34, 39, 31, 31, 29, 31, 43, 41, 32, 191, 40, 43, 49, 59, 38, 41, 42, 255, 64, 43, 65, 331, 48, 59, 62, 111, 52, 79, 53, 91, 55, 75, 61, 199, 71, 65, 86, 99, 65, 127, 74
Offset: 0

Views

Author

Hugo Pfoertner, Jan 12 2020

Keywords

Comments

If it exists, a(63) > 10000.

Examples

			a(0) = 1: 2^1 - 2^0 + 1 = 2 = A331205(0) is prime,
a(1) = 2: 2^2 - 2^1 + 1 = 3 = A331205(1) is prime,
a(2) = 3: 2^3 - 2^2 + 1 = 5 = A331205(2) is prime,
a(3) = 39: 2^39 - 2^3 + 1 = 549755813881 = A331205(3) is prime, whereas all smaller values of m give composite sums: 9, 25, 57, 121, 249, 505, ..., 274877906937.
		

Crossrefs

Cf. A181692, A331205 (corresponding primes).

Programs

  • PARI
    for(n=0,62, for(m=n+1,oo, k=2^m-2^n+1; if(isprime(k), print1(m,", "); break)))

A331217 a(n) is the least prime of the form 2^m - 2^n - 1.

Original entry on oeis.org

2, 5, 3, 7, 47, 31, 191, 127, 16127, 3583, 15359, 6143, 1044479, 8191, 245759, 16744447, 4128767, 131071, 786431, 524287, 274876858367, 14680063, 4398042316799, 260046847, 4278190079, 4261412863, 1125899839733759, 576460752169205759, 16911433727
Offset: 0

Views

Author

Hugo Pfoertner, Jan 12 2020

Keywords

Examples

			a(1) = 2: 2^2 - 2^0 - 1 = 2, thus exponent 2 = A181692(0);
a(2) = 5: 2^3 - 2^1 - 1 = 5, 2^2 - 2^1 - 1 = 1 is not a prime, A181692(1) = 3;
a(4) = 47: 2^6 - 2^4 - 1 = 31, whereas the first candidate 2^5 - 2^4 - 1 = 15 is composite.
		

Crossrefs

Cf. A181692 (corresponding values of m), A331204, A331205.

Programs

  • Magma
    a:=[]; for n in [0..30] do m:=n+1; while not IsPrime(2^m-2^n-1) do m:=m+1; end while; Append(~a,2^m-2^n-1); end for; a; // Marius A. Burtea, Jan 13 2020
  • Maple
    f:= proc(n) local m, p;
       p:= -1;
       for m from n do
         p:= p + 2^m;
         if isprime(p) then return p fi
        od
    end proc:
    map(f, [$0..30]); # Robert Israel, Jan 13 2020
  • Mathematica
    a[n_] := For[m = n+1, True, m++, If[PrimeQ[p = 2^m-2^n-1], Return[p]]];
    a /@ Range[0, 28] (* Jean-François Alcover, Oct 25 2020 *)
  • PARI
    for(n=0,28, for(m=n+1,oo, k=2^m-2^n-1; if(isprime(k), print1(k,", "); break)))
    
Showing 1-5 of 5 results.