Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #17 Jun 25 2024 11:24:51
%S 5,5,5,7,7,5,5,5,5,7,7,5,5,5,7,7,7,5,5,11,5,7,7,5,11,5,5,13,13,7,5,5,
%T 5,7,13,5,5,5,5,7,7,5,11,17,7,7,7,5,5,11,5,7,7,5,17,5,13,13,13,7,5,5,
%U 5,7,7,5,5,5,11,13,7,7,5,5,7,7,13,5,5,17,5,7,7,5,11,11,5,13,13,7,11,5,5
%N The prime q>=5 such that n divides p-q, where p>q is the least prime for which such a prime q exists.
%C For a guide to related sequences, see A204892.
%H Robert Israel, <a href="/A204911/b204911.txt">Table of n, a(n) for n = 1..10000</a>
%p f:= proc(n) local V,q,r;
%p V:= Array(0..n-1); q:= 4;
%p do
%p q:= nextprime(q);
%p r:= q mod n;
%p if V[r] = 0 then V[r]:= q
%p else return V[r]
%p fi
%p od
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Jul 24 2018
%t (See the program at A204908.)
%o (Python)
%o from sympy import nextprime
%o def a(n):
%o V, q = [0 for _ in range(n)], 4
%o while True:
%o q = nextprime(q)
%o r = q%n
%o if V[r] == 0: V[r] = q
%o else: return int(V[r])
%o print([a(n) for n in range(1, 94)]) # _Michael S. Branicky_, Jun 25 2024 after _Robert Israel_
%Y Cf. A204908, A204900, A204892.
%K nonn
%O 1,1
%A _Clark Kimberling_, Jan 20 2012
%E More terms from _Robert G. Wilson v_, Jul 24 2018