login
A269668
Smallest k >= 0 such that neither (k + 1)*n - k nor (k + 1)*n + k is prime.
2
0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 7, 0, 1, 0, 0, 0, 1, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 10, 0, 2, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 3
OFFSET
1,2
COMMENTS
Numbers n such that a(n) = m: 2, 31, 41, 131, 157, ... (for m = 2);
3, 53, 83, 97, 139, ... (for m = 3); 19, 23, 79, 191, ... (for m = 4), ...
LINKS
EXAMPLE
For n = 2, k = 0: (0 + 1)*2 - 0 = 2 is prime and (0 + 1)*2 + 0 = 2 is prime; for n = 2, k = 1: (1 + 1)*2 - 1 = 3 is prime and (1 + 1)*2 + 1 = 5 is prime; for n = 2, k = 2: (2 + 1)*2 - 2 = 4 is composite and (2 + 1)*2 + 2 = 6 is composite, so a(2) = 2.
MATHEMATICA
Table[SelectFirst[Range[0, 120], And[! PrimeQ[n (# + 1) - #], ! PrimeQ[n (# + 1) + #]] &], {n, 120}] (* Michael De Vlieger, Mar 04 2016, Version 10 *)
PROG
(PARI) A269668(n) = {my(k=0); while (isprime((k+1)*n-k) || isprime((k+1)*n+k), k++); k; } \\ Michel Marcus, Apr 04 2016, corrected by Antti Karttunen, Dec 27 2018
CROSSREFS
Cf. A018252 (a(n) = 0), A068497 (a(n) = 1).
Sequence in context: A145091 A085563 A071375 * A061397 A331045 A331044
KEYWORD
nonn
AUTHOR
EXTENSIONS
Definition corrected by Michael De Vlieger, Mar 04 2016
STATUS
approved