login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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

Antti Karttunen, Table of n, a(n) for n = 1..20000

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

Adjacent sequences:  A269665 A269666 A269667 * A269669 A269670 A269671

KEYWORD

nonn

AUTHOR

Juri-Stepan Gerasimov, Mar 03 2016

EXTENSIONS

Definition corrected by Michael De Vlieger, Mar 04 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 30 23:12 EDT 2021. Contains 346365 sequences. (Running on oeis4.)