OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000, probable primes for n > 150
Paul Pollack and Vladimir Shevelev, On perfect and near-perfect numbers, J. Number Theory 132 (2012), pp. 3037-3046. - N. J. A. Sloane, Sep 04 2012
Vladimir Shevelev, Perfect and near-perfect numbers, arXiv:1011.6160 [math.NT], 2010-2012.
FORMULA
Conjecture: equals the intersection of A000040 and A081118 or the intersection of A000040 and A089633. [R. J. Mathar, Nov 18 2010]
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 *)
PROG
(Haskell)
a181741 n = a181741_list !! (n-1)
a181741_list = filter ((== 1) . a010051) a081118_list
-- Reinhard Zumkeller, Feb 23 2012
(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<<t-1
for k in range(t-1, 0, -1):
if isprime(s:=m-r-1):
yield s
r>>=1
m<<=1
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Nov 08 2010
EXTENSIONS
Corrected (251 and 1019 inserted) and extended by R. J. Mathar, Nov 18 2010
STATUS
approved