OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..5800
EXAMPLE
31 = prime(11) is a term: prime(11) + 2*11 = 31 + 22 = 53 is also prime.
89 = prime(24) is a term: prime(24) + 2*24 = 89 + 48 = 137 is also prime.
MAPLE
KD := proc() local a, b; a:= ithprime(n); b:= a+2*n; if isprime(b) then RETURN (a); fi; end: seq(KD(), n=1..500);
MATHEMATICA
t = Select[Table[{Prime[n], Prime[n] + 2*n}, {n, 200}], PrimeQ[#[[2]]] &]; Transpose[t][[1]] (* T. D. Noe, Nov 06 2013 *)
PROG
(PARI) is(n)=isprime(n+2*primepi(n)) && isprime(n) \\ Charles R Greathouse IV, Aug 25 2014
(Magma) [NthPrime(n): n in [1..250] | IsPrime(NthPrime(n)+2*n)]; // Vincenzo Librandi, Jan 19 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
K. D. Bajpai, Nov 06 2013
EXTENSIONS
Name edited by David A. Corneth, Sep 07 2023
STATUS
approved