OFFSET
1,1
COMMENTS
For a guide to related sequences, see A204892.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local V, q, r;
V:= Array(0..n-1); q:= 4;
do
q:= nextprime(q);
r:= q mod n;
if V[r] = 0 then V[r]:= q
else return V[r]
fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Jul 24 2018
MATHEMATICA
(See the program at A204908.)
PROG
(Python)
from sympy import nextprime
def a(n):
V, q = [0 for _ in range(n)], 4
while True:
q = nextprime(q)
r = q%n
if V[r] == 0: V[r] = q
else: return int(V[r])
print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jun 25 2024 after Robert Israel
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 20 2012
EXTENSIONS
More terms from Robert G. Wilson v, Jul 24 2018
STATUS
approved