cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A269668 Smallest k >= 0 such that neither (k + 1)*n - k nor (k + 1)*n + k is prime.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Mar 03 2016

Keywords

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), ...

Examples

			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.
		

Crossrefs

Cf. A018252 (a(n) = 0), A068497 (a(n) = 1).

Programs

  • Mathematica
    Table[SelectFirst[Range[0, 120], And[! PrimeQ[n (# + 1) - #], ! PrimeQ[n (# + 1) + #]] &], {n, 120}] (* Michael De Vlieger, Mar 04 2016, Version 10 *)
  • 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

Extensions

Definition corrected by Michael De Vlieger, Mar 04 2016