OFFSET
1,2
COMMENTS
a(n) is divisible by 3 for n >= 3. - Robert Israel, May 08 2015
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
2 is in this sequence because 2*2*prime(2) - 1 = 11 and 2*2*prime(2) + 1 = 13 are both prime.
MAPLE
filter:= proc(n)
local p;
p:= ithprime(n);
isprime(2*n*p+1) and isprime(2*n*p-1)
end proc:
select(filter, [1, 2, seq(3*j, j=1..10^5)]); # Robert Israel, May 08 2015
MATHEMATICA
Select[Range[3000], PrimeQ[2 # Prime[#] - 1] && PrimeQ[2 # Prime[#] + 1] &] (* Vincenzo Librandi, May 09 2015 *)
Select[Range[4200], AllTrue[2# Prime[#]+{1, -1}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Dec 08 2018 *)
PROG
(Magma) [n: n in [1..4500] | IsPrime(2*n*NthPrime(n)-1) and IsPrime(2*n*NthPrime(n)+1)];
(PARI) v=List(); n=0; forprime(p=2, 1e5, n++; if(isprime(2*n*p-1) && isprime(2*n*p+1), listput(v, n))); Vec(v) \\ Charles R Greathouse IV, May 08 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, May 08 2015
STATUS
approved