OFFSET
1,1
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000 (first 2000 from Robert Israel)
MAPLE
filter:= p -> isprime(p) and andmap(t -> not isprime(p+t), numtheory:-divisors(p^2-1)):
select(filter, [seq(i, i=3..10^6, 2)]);
PROG
(PARI) is(n) = if(isprime(n), fordiv(n^2-1, d, if(isprime(n+d), return(0))); 1, 0) \\ Iain Fox, Nov 27 2017
(PARI) is(n)=my(o=valuation(n+1, 2), f1=factor((n-1)<<o), f2=factor((n+1)>>o, f), f=Mat(vecsort(Vec(concat(f1~, f2~)), 1))~); fordiv(f, d, if(isprime(n+d), return(0))); isprime(n) \\ Charles R Greathouse IV, Nov 28 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, Nov 27 2017
STATUS
approved