OFFSET
1,1
COMMENTS
There is always at least one prime of the given form, namely x+1 = x-1+2.
Primes are counted only once even if they are of both forms.
EXAMPLE
a(4)=12 with 4 primes of the given form for x=12: 13 = 11+2, 17 = 11+6 = 13+4, 19 = 13+6 and 23 = 11+12.
MAPLE
f:= proc(x) local d;
d:= numtheory:-divisors(x);
nops(select(isprime, map(`+`, d, x-1) union map(`+`, d, x+1)))
end proc:
T:= select(t -> isprime(t-1) and isprime(t+1), [4, seq(i, i=6..10^6, 6)]):
fT:= map(f, T):
V:= Vector(max(fT)):
for i from 1 to nops(T) do
if V[fT[i]] = 0 then V[fT[i]]:= T[i] fi
od:
if not member(0, V, 'm') then m:=nops(T)+1 fi:
convert(V[1..m-1], list);
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 30 2020
STATUS
approved