%I #4 Sep 24 2017 17:02:04
%S 1,2,2,4,2,6,6,5,8,10,8,9,12,14,14,16,14,17,12,20,20,21,20,24,24,26,
%T 20,27,18,27,22,29,30,33,30,36,34,32,38,40,38,41,40,33,40,43,44,45,34,
%U 47,50,49,44,54,54,56,54,57,54,59,58,59,62,54,54,66,66,65,58,69,60,71,64
%N Maximum k with 1 <= k <= n such that nk + 1 is prime (or 0 if no such prime exists).
%C It is conjectured that nonzero terms exist for each n: see A089727, the main entry.
%C a(n) = n iff n is a term of A005574.
%t mk[n_]:=Module[{k=n},While[!PrimeQ[n*k+1],k--];If[k<1,0,k]]; Array[mk,80] (* _Harvey P. Dale_, Sep 24 2017 *)
%o (PARI) {A171751(n) = local(k); k=n; while(!isprime(n*k+1) && k>0, k--); k}
%Y Cf. A089727 (corresponding primes), A005574.
%K nonn
%O 1,2
%A _Rick L. Shepherd_, Dec 17 2009
|