OFFSET
1,1
COMMENTS
a(n) = A112786(n-1) for 2 <= n <= 18 but not for n = 19, and apparently not for any n > 25.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = 7, a possible sequence is 5, 7, 11, 17, 19, 23, 29 so a(7) = 29.
MAPLE
G:= proc(p, m) option remember; local q;
if m = 1 then return true fi;
if p < ithprime(m) then return false fi;
q:= p;
while q > 2 do
q:= prevprime(q);
if isprime(q) and isprime(q+p+1) and procname(q, m-1) then return true fi;
od;
false
end proc:
f:= proc(n) local p;
p:= ithprime(n);
do
if G(p, n) then return p fi;
p:= nextprime(p)
od
end proc:
map(f, [$1..100]);
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert Israel, May 02 2023
STATUS
approved