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.

A050299 Numbers k such that ((k-1)! + 1)/k is prime.

Original entry on oeis.org

1, 5, 7, 11, 29, 773, 1321, 2621
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2003

Keywords

Comments

Except for the first term, all terms are primes because for n > 1, n divides (n-1)! + 1 iff n is prime. - Farideh Firoozbakht, Mar 19 2004
a(9) >= 30941.

Examples

			7 is in the sequence because (6!+1)/7=103 is prime.
		

Programs

  • Mathematica
    v={1};Do[If[PrimeQ[((Prime[n]-1)!+1)/Prime[n]], v=Append[v, Prime[n]];Print[v]], {n, 845}]
    Select[Range[2630],PrimeQ[((#-1)!+1)/#]&] (* Harvey P. Dale, Aug 18 2024 *)
  • PARI
    is(n)=((n-1)!+1)%n==0 && isprime(((n-1)!+1)/n) \\ Anders Hellström, Nov 22 2015

Formula

((a(n)-1)! + 1)/a(n) = A122696(n) = A007619(A000720(A050299(n))) for n > 1. - Jonathan Sondow, Aug 07 2011
a(n) = prime(A225906(n-1)) for n > 1. - Jonathan Sondow, May 20 2013

Extensions

a(7)-a(8) from Mike Oakes, Aug 20 2003