OFFSET
1,3
FORMULA
a(n) = 2*n - pi(2*p_n).
a(n) = 2*n - A020900(n). - Michel Marcus, Sep 11 2020
a(n) = 1 + A331677(n). - Alois P. Heinz, Oct 09 2020
EXAMPLE
a(6) = 2*6 - pi(2*p_6) = 12 - pi(2*13) = 12 - pi(26) = 12 - 9 = 3.
PROG
(Python)
from sympy import prime, primepi
for n in range(1, 10001):
a = 2*n - primepi(2*prime(n))
print(a)
(PARI) a(n) = 2*n - primepi(2*prime(n)); \\ Michel Marcus, Sep 11 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Sep 11 2020
STATUS
approved