OFFSET
1,3
LINKS
Artsiom Palkounikau, Table of n, a(n) for n = 1..3072
FORMULA
a(n) = (A057821(n+1) + 1)/2.
MATHEMATICA
Table[k=0; While[!(PrimeQ[p=2^n-k]&&PrimeQ[2p+1]), k++]; k, {n, 58}] (* Giorgos Kalogeropoulos, Sep 15 2021 *)
PROG
(Python)
from sympy import isprime
def a(n):
k = 0
while True:
if isprime(2 ** n - k) and isprime(2 * (2 ** n - k) + 1):
return k
k += 1
print([a(i) for i in range(1, 21)])
(PARI) a(n) = my(k=0, p); while (!(isprime(p=2^n-k) && isprime(2*p+1)), k++); k; \\ Michel Marcus, Sep 15 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Artsiom Palkounikau, Sep 15 2021
STATUS
approved