OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Roberto Conti and Pierluigi Contucci, A Natural Avenue, arXiv:2204.08982 [math.NT], 2022.
MAPLE
f:= p-> (q-> andmap(isprime, [q, (p+1)/2^q]))(padic[ordp](p+1, 2)):
select(f, [ithprime(i)$i=1..500])[]; # Alois P. Heinz, May 01 2022
MATHEMATICA
Select[Prime[Range[400]], PrimeQ[(q = IntegerExponent[# + 1, 2])] && PrimeQ[(# + 1)/2^q] &] (* Amiram Eldar, May 01 2022 *)
PROG
(Python)
from sympy import isprime, nextprime
from itertools import islice
def valuation(n, p):
v = 0
while n%p == 0: n //= p; v += 1
return v, n
def agen(): # generator of terms
p = 2
while True:
q, r = valuation(p+1, 2)
if isprime(q) and isprime(r): yield p
p = nextprime(p)
print(list(islice(agen(), 49))) # Michael S. Branicky, May 01 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 01 2022
EXTENSIONS
a(12) and beyond from Michael S. Branicky, May 01 2022
STATUS
approved