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.
%I A181741 #40 May 11 2023 03:14:35 %S A181741 3,5,7,11,13,23,29,31,47,59,61,127,191,223,239,251,383,479,503,509, %T A181741 991,1019,1021,2039,3583,3967,4079,4091,4093,6143,8191,15359,16127, %U A181741 16319,16381,63487,65407,65519,129023,131063,131071,245759,253951,261631,261887,262079,262111,262127,262139 %N A181741 Primes of the form 2^t-2^k-1, k>=1. %C A181741 All Mersenne primes A000668(i) are in the sequence, parametrized by t=A000043(i)+1 and k=A000043(i). %C A181741 If p is in the sequence, then the exponents t and k are unique. %C A181741 For given k, the smallest value of t defines sequence A181692. %C A181741 Every term p=2^t-2^k-1 in this sequence here generates an entry 2^(t-1)*p in A181595 (cf. A181701). %H A181741 Reinhard Zumkeller, <a href="/A181741/b181741.txt">Table of n, a(n) for n = 1..1000, probable primes for n > 150</a> %H A181741 Paul Pollack and Vladimir Shevelev, <a href="https://doi.org/10.1016/j.jnt.2012.06.008">On perfect and near-perfect numbers</a>, J. Number Theory 132 (2012), pp. 3037-3046. - _N. J. A. Sloane_, Sep 04 2012 %H A181741 Vladimir Shevelev, <a href="http://arxiv.org/abs/1011.6160">Perfect and near-perfect numbers</a>, arXiv:1011.6160 [math.NT], 2010-2012. %F A181741 Conjecture: equals the intersection of A000040 and A081118 or the intersection of A000040 and A089633. [_R. J. Mathar_, Nov 18 2010] %p A181741 isA000079 := proc(n) if n = 1 then true; elif type(n,'odd') then false; else if nops( numtheory[factorset](n) ) = 1 then true; else %p A181741 false; end if; end if; end proc: %p A181741 isA181741 := proc(p) if isprime(p) then k := A007814(p+1) ; (p+1)/2^k+1 ; return ( isA000079(%) and k >=1 ) ; else %p A181741 false; end if; end proc: %p A181741 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 %t A181741 Select[Table[2^t-2^k-1, {t, 1, 20}, {k, 1, t-1}] // Flatten // Union, PrimeQ] (* _Jean-François Alcover_, Nov 16 2017 *) %o A181741 (Haskell) %o A181741 a181741 n = a181741_list !! (n-1) %o A181741 a181741_list = filter ((== 1) . a010051) a081118_list %o A181741 -- _Reinhard Zumkeller_, Feb 23 2012 %o A181741 (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 %o A181741 (Python) %o A181741 from itertools import count, islice %o A181741 from sympy import isprime %o A181741 def A181741_gen(): # generator of terms %o A181741 m = 2 %o A181741 for t in count(1): %o A181741 r=1<<t-1 %o A181741 for k in range(t-1,0,-1): %o A181741 if isprime(s:=m-r-1): %o A181741 yield s %o A181741 r>>=1 %o A181741 m<<=1 %o A181741 A181741_list = list(islice(A181741_gen(),30)) # _Chai Wah Wu_, Jul 08 2022 %Y A181741 Cf. A181595, A181692, A181701, A000043. %Y A181741 Cf. A010051, primes in A081118, see also A208083. %K A181741 nonn %O A181741 1,1 %A A181741 _Vladimir Shevelev_, Nov 08 2010 %E A181741 Corrected (251 and 1019 inserted) and extended by _R. J. Mathar_, Nov 18 2010