

A171751


Maximum k with 1 <= k <= n such that nk + 1 is prime (or 0 if no such prime exists).


1



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, 20, 27, 18, 27, 22, 29, 30, 33, 30, 36, 34, 32, 38, 40, 38, 41, 40, 33, 40, 43, 44, 45, 34, 47, 50, 49, 44, 54, 54, 56, 54, 57, 54, 59, 58, 59, 62, 54, 54, 66, 66, 65, 58, 69, 60, 71, 64
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

It is conjectured that nonzero terms exist for each n: see A089727, the main entry.
a(n) = n iff n is a term of A005574.


LINKS

Table of n, a(n) for n=1..73.


MATHEMATICA

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 *)


PROG

(PARI) {A171751(n) = local(k); k=n; while(!isprime(n*k+1) && k>0, k); k}


CROSSREFS

Cf. A089727 (corresponding primes), A005574.
Sequence in context: A054929 A236628 A078429 * A124676 A076249 A062170
Adjacent sequences: A171748 A171749 A171750 * A171752 A171753 A171754


KEYWORD

nonn


AUTHOR

Rick L. Shepherd, Dec 17 2009


STATUS

approved



