OFFSET
1,1
COMMENTS
a(n) >= 4*prime(n)-prime(n+1), with equality when prime(n) is in A227907.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=5 we have prime(5)=11 and prime(6)=13, and a(5)=31 because of the numbers == -13 (mod 11) and greater than 13 (20, 31, ...), 31 is the first prime.
MAPLE
f:= proc(n) local p, q, r0, r;
p:= ithprime(n);
q:= nextprime(p);
for r from 4*p-q by p do if isprime(r) then return r fi od;
end proc:
map(f, [$1..100]);
PROG
(PARI) a(n) = my(p=prime(n+2)); while(Mod(p, prime(n)) != -prime(n+1), p = nextprime(p+1)); p; \\ Michel Marcus, Dec 13 2020
CROSSREFS
KEYWORD
nonn,look
AUTHOR
J. M. Bergot and Robert Israel, Dec 13 2020
STATUS
approved