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.

This page as a plain text file.
%I A269668 #30 Dec 27 2018 17:35:31
%S A269668 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,
%T A269668 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,
%U A269668 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
%N A269668 Smallest k >= 0 such that neither (k + 1)*n - k nor (k + 1)*n + k is prime.
%C A269668 Numbers n such that a(n) = m: 2, 31, 41, 131, 157, ... (for m = 2);
%C A269668 3, 53, 83, 97, 139, ... (for m = 3); 19, 23, 79, 191, ... (for m = 4), ...
%H A269668 Antti Karttunen, <a href="/A269668/b269668.txt">Table of n, a(n) for n = 1..20000</a>
%e A269668 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.
%t A269668 Table[SelectFirst[Range[0, 120], And[! PrimeQ[n (# + 1) - #], ! PrimeQ[n (# + 1) + #]] &], {n, 120}] (* _Michael De Vlieger_, Mar 04 2016, Version 10 *)
%o A269668 (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
%Y A269668 Cf. A018252 (a(n) = 0), A068497 (a(n) = 1).
%K A269668 nonn
%O A269668 1,2
%A A269668 _Juri-Stepan Gerasimov_, Mar 03 2016
%E A269668 Definition corrected by _Michael De Vlieger_, Mar 04 2016