OFFSET
1,1
COMMENTS
This sequence and the sequence of resulting primes, prime(q)-q-1 (5, 41, 2027, 5801, 41491, ...), are subsequences of A006450, the prime-indexed primes.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..500
N. Fernandez, An order of primeness, F(p)
N. Fernandez, An order of primeness [cached copy, included with permission of the author]
MAPLE
N := 1000000;
for n to N do
if isprime(n) then q := ithprime(n);
Z := numtheory[pi](n);
S := q-n-1;
W := numtheory[pi](S);
if isprime(Z) and isprime(S) and isprime(W) then print(n);
end if:
end if:
end do:
MATHEMATICA
pipQ[n_]:=Module[{c=Prime[n]-n-1}, AllTrue[{PrimePi[n], c, PrimePi[ c]}, PrimeQ]]; Select[Prime[Range[30000]], pipQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 30 2020 *)
PROG
(PARI) isok(p) = isprime(p) && isprime(primepi(p)) && isprime(q=prime(p)-p-1) && isprime(primepi(q)); \\ Michel Marcus, Sep 03 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Sep 02 2018
EXTENSIONS
Corrected and extended by Harvey P. Dale, Jun 30 2020
STATUS
approved