OFFSET
1,2
EXAMPLE
a(1) = 1 because 2*p(p(p(1)))-3 = 7 = prime and 3*p(p(p(1)))-2 = 13 = prime;
a(2) = 2 because 2*p(p(p(2)))-3 = 19 = prime and 3*p(p(p(2)))-2 = 31 = prime;
a(3) = 5 because 2*p(p(p(5)))-3 = 379 = prime and 3*p(p(p(5)))-2 = 251 = prime;
a(4) = 8 because 2*p(p(p(8)))-3 = 991 = prime and 3*p(p(p(8)))-2 = 659 = prime;
a(5) = 9 because 2*p(p(p(9)))-3 = 1291 = prime and 3*p(p(p(9)))-2 = 859 = prime;
a(6) = 15 because 2*p(p(p(15)))-3 = 3889 = prime and 3*p(p(p(15)))-2 = 2591 = prime.
MATHEMATICA
pppQ[n_]:=Module[{p=Prime[Prime[Prime[n]]]}, AllTrue[{2p-3, 3p-2}, PrimeQ]]; Select[Range[1400], pppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 25 2016 *)
PROG
(PARI) isok(n) = isprime(2*prime(prime(prime(n)))-3) && isprime(3*prime(prime(prime(n)))-2); \\ Michel Marcus, Sep 02 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Feb 15 2010
EXTENSIONS
Extended beyond 15 by R. J. Mathar, Mar 01 2010
STATUS
approved