(Translated by https://www.hiragana.jp/)
A172133 - OEIS
login
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
OFFSET
1,3
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
KEYWORD
nonn
AUTHOR
Cheng Zhang (cz1(AT)rice.edu), Jan 26 2010
STATUS
approved