login
A362770
a(n) is the least prime p that ends an increasing sequence x(1), ..., x(n) = p of primes such that x(i) + x(i+1) + 1 is prime for 1 <= i <= n-1.
1
2, 7, 11, 17, 19, 23, 29, 31, 41, 47, 53, 59, 67, 71, 79, 83, 89, 101, 107, 113, 127, 139, 157, 167, 179, 191, 197, 199, 227, 229, 233, 257, 263, 277, 293, 307, 311, 331, 353, 367, 383, 389, 397, 431, 443, 457, 461, 467, 479, 487, 499, 509, 521, 541, 569, 593, 599, 601, 617, 619, 647, 653, 661
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
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
Sequence in context: A079140 A357843 A176897 * A166005 A243009 A155009
KEYWORD
nonn
AUTHOR
Robert Israel, May 02 2023
STATUS
approved