OFFSET
1,1
EXAMPLE
a(4) = 13 since 7, 13 and 19 are primes in arithmetic progression, 7 is the fourth prime number, and there is no longer one starting with 7 than another prime less than 2*7 = 14.
a(12) = 67 since prime(12) = 37 and 67, 97, 127 and 157 are also primes in arithmetic progression of common difference 30.
PROG
(PARI) A339501(n)= {
my(p=prime(n), bp, bk);
forprime(np=p+1, 2*p, for(k=2, +oo, if(!isprime(p+k*(np-p)), if(k>bk, bk=k; bp=np; ); break); ); );
return(bp);
}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
François Marques, Dec 07 2020
STATUS
approved