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.

A035093 Smallest k such that k*n! + 1 is prime.

Original entry on oeis.org

1, 1, 1, 3, 2, 3, 3, 4, 3, 3, 1, 2, 3, 13, 7, 4, 5, 2, 7, 17, 15, 18, 3, 6, 3, 16, 1, 4, 7, 20, 8, 3, 9, 5, 2, 7, 1, 3, 10, 3, 1, 29, 7, 9, 45, 8, 3, 6, 35, 66, 2, 20, 2, 4, 25, 52, 14, 34, 24, 6, 10, 22, 38, 16, 20, 91, 69, 12, 19, 20, 21, 42, 1, 5, 33, 77, 1, 2, 12, 29, 193, 74, 40, 55, 19
Offset: 1

Views

Author

Keywords

Comments

This is one possible generalization of "the least prime problem" for n*k+1 arithmetic progression when n is replaced by n!, a special difference.

Examples

			a(7)=3 because in progression of 5040*k+1 the terms 5041 and 10081 are not prime and so 15121 is the first prime.
		

Crossrefs

Analogous case is A034693. Special case for k=1 is A002981.

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[1 + k*n!], k++]; k, {n, 85}] (* T. D. Noe, Nov 04 2013 *)
  • PARI
    a(n) = my(k=1); while(!isprime(k*n!+1), k++); k; \\ Michel Marcus, Sep 26 2020

Extensions

a(80) corrected by Alex Ratushnyak, Nov 03 2013
Simpler title by Sean A. Irvine, Sep 25 2020