OFFSET
1,1
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..6400
EXAMPLE
The first prime, 2, is not a term since |2-3*1| = 1.
The second prime, 3, is a term, since |3-2*3| = 3 is a prime.
a(11) = 79 which is the 22nd prime, prime(22)-3*22 = 79-66 = 13 which is also prime.
a(15) = 113 which is the 30th prime, prime(30)-3*30 = 113-90 = 23 which is also prime.
MAPLE
KD := proc() local a, b; a:= ithprime(n); b:= abs(a-3*n); if isprime(b) then RETURN (a); fi; end: seq(KD(), n=1..500);
MATHEMATICA
KD = Select[Table[{Prime[n], Prime[n] - 3*n}, {n, 200}], PrimeQ[#[[2]]] &]; Transpose[KD][[1]]
Select[Table[{k, Prime[k]}, {k, 200}], PrimeQ[Abs[#[[2]]-3#[[1]]]]&][[;; , 2]] (* Harvey P. Dale, Jul 14 2024 *)
PROG
(PARI) k=0; forprime(p=2, 1e3, if(isprime(abs(p-k++*3)), print1(p", "))) \\ Charles R Greathouse IV, Mar 11 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
K. D. Bajpai, Nov 09 2013
STATUS
approved