OFFSET
1,1
COMMENTS
If p is prime and q is the next prime, the greatest perimeter is p+q+r where r is the greatest prime < p+q.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 13 is a term because the next prime is 17, the greatest prime < 13+17 is 29, and 13+17+29 = 59 is prime.
MAPLE
f:= proc(n) local p, q, r, s;
p:= ithprime(n);
q:= ithprime(n+1);
r:= prevprime(p+q);
s:= p+q+r;
if isprime(p+q+r) then return p fi
end proc:
map(f, [$1..500]);
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Jul 15 2021
STATUS
approved