%I #18 Oct 08 2024 05:06:39
%S 2,5,13,13,31,31,71,73,73,71,199,157,157,197,241,241,409,199,419,401,
%T 547,419,691,409,701,547,919,701,929,691,1117,929,1321,919,1471,1117,
%U 1777,1483,1483,1321,2297,1471,1979,2069,2251,1979,2069,1777,2549,2251
%N Smallest prime of the form n*k + 1, where each k may be used in the sequence only once.
%H Andrew Howroyd, <a href="/A111296/b111296.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = n*A087559(n) + 1.
%e a(10) = 10*13 + 1 = 131 though 10*10 + 1 = 101 is also prime but k=10 has already been used by n=7.
%t l = {}; Do[k = 1; While[MemberQ[l, k] || !PrimeQ[n*k + 1], k++ ]; Print[n*k+1]; AppendTo[l, k], {n, 30}] (* _Ryan Propper_, Jun 15 2006 *)
%o (PARI) seq(n)={my(a=vector(n), M=Map()); for(n=1, #a, my(k=1); while(mapisdefined(M,k) || !isprime(n*k+1), k++); a[n]=n*k+1; mapput(M,k,1)); a} \\ _Andrew Howroyd_, Oct 07 2024
%Y Cf. A087559.
%K nonn
%O 1,1
%A _Amarnath Murthy_, Nov 11 2005
%E Corrected and extended by _Ryan Propper_, Jun 15 2006
%E More terms from _R. J. Mathar_, Aug 20 2007