OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 19 because 19 is the least prime == 4 (mod prime(3)).
a(4) = 11 because 11 is the least prime == 4 (mod prime(4)).
MAPLE
a:= proc(n) local q, p; p:= ithprime(n); q:= p;
do if irem(q-4, p)=0 then break fi;
q:= nextprime(q);
od; q
end:
seq(a(n), n=1..60); # Alois P. Heinz, May 03 2021
MATHEMATICA
s = {}; p = 5; Do[q = p + 2; While[Mod[q, p] != 4, q = NextPrime[q]]; AppendTo[s, q]; p = NextPrime[p], {100}]; s
PROG
(PARI) a(n) = my(p=prime(n)); forprime(q=2, , if (Mod(q, p) == 4, return(q))); \\ Michel Marcus, May 03 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 03 2021
STATUS
approved