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!)
A172133 Smallest k such that n(n+1)(n+2)...(n+k-1)+1 is prime. 2
1, 1, 2, 1, 2, 1, 5, 2, 3, 1, 10, 1, 3, 2, 2, 1, 2, 1, 5, 2, 2, 1, 18, 2, 3, 6, 2, 1, 9, 1, 12, 7, 2, 3, 8, 1, 74, 2, 5, 1, 2, 1, 14, 3, 6, 1, 9, 18, 3, 2, 3, 1, 3, 2, 19, 3, 2, 1, 2, 1, 3, 2, 115, 5, 6, 1, 16, 5, 2, 1, 2, 1, 5, 3, 2, 3, 2, 1, 6, 2, 6, 1, 3, 3, 10, 3, 5, 1, 2, 2, 3, 24, 8, 3, 13, 1, 13, 3, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

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

FORMULA

a(n) = A087565(n) + 1. - Filip Zaludek, Dec 16 2016

EXAMPLE

a(2)=1 because 2+1=3 is a prime. a(3)=2 because 3+1=4 is not a prime, but 3*4+1=13 is a prime. a(9)=3 because neither 9+1=10 nor 9*10+1=91=13*7 is a prime, but 9*10*11+1=991 is.

MATHEMATICA

a[n_] := Block[{}, For[s = n; k = 1, ! PrimeQ[s + 1], s *= n + k; k++ ]; k] Table[a[n], {n, 1, 100}]

(* Second program *)

Table[k = 1; While[! PrimeQ[1 + Pochhammer[n, k]], k++]; k, {n, 99}] (* Michael De Vlieger, Dec 17 2016 *)

PROG

(PARI) a(n)=my(N=n, k=n); while(!ispseudoprime(N+1), N*=k++); k-n+1 \\ Charles R Greathouse IV, May 15 2013

CROSSREFS

Cf. A087564.

Sequence in context: A128644 A201733 A000001 * A146002 A109087 A102048

Adjacent sequences:  A172130 A172131 A172132 * A172134 A172135 A172136

KEYWORD

nonn

AUTHOR

Cheng Zhang (cz1(AT)rice.edu), Jan 26 2010

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 October 1 13:04 EDT 2020. Contains 337443 sequences. (Running on oeis4.)