login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A057217 a(n) = smallest positive integer k such that 1+n*k! is a prime. 8
1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 4, 2, 2, 1, 2, 4, 3, 2, 3, 1, 2, 1, 7, 3, 2, 6, 2, 1, 3, 3, 2, 1, 2, 1, 4, 2, 3, 1, 3, 2, 5, 2, 2, 1, 2, 2, 3, 2, 5, 1, 11, 1, 3, 3, 2, 5, 2, 1, 4, 2, 2, 1, 5, 1, 3, 2, 2, 3, 3, 1, 14, 5, 2, 1, 2, 4, 7, 2, 3, 1, 2, 2, 3, 8, 5, 7, 2, 1, 11, 2, 2, 1, 3, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

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

FORMULA

a(n) = Min{k|1+nk! is prime}.

EXAMPLE

n=7, 1+7.k!={8,15,43,169,...}. The smallest k which gives prime is 3 and the prime so obtained is 43.

n=267, the smallest k! is 31! for which 1+267*k! is prime and the prime so obtained is 65782709233423382541804503040000001.

MATHEMATICA

spi[n_]:=Module[{k=1}, While[!PrimeQ[1+k!*n], k++]; k]; Array[spi, 110] (* Harvey P. Dale, May 01 2016 *)

PROG

(PARI) a(n) = k = 1; while (!isprime(1+n*k!), k++); k; \\ Michel Marcus, Feb 20 2016

CROSSREFS

Sequence in context: A235875 A204893 A251717 * A193330 A147810 A305302

Adjacent sequences:  A057214 A057215 A057216 * A057218 A057219 A057220

KEYWORD

nonn

AUTHOR

Labos Elemer, Sep 27 2000

EXTENSIONS

Offset corrected by Michel Marcus, Feb 20 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 June 18 07:44 EDT 2019. Contains 324203 sequences. (Running on oeis4.)