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.

A240160 Least number k such that (k!-n)/k is prime, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 0, 4, 5, 0, 7, 8, 0, 0, 0, 4, 13, 0, 15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 31, 0, 33, 34, 5, 0, 0, 0, 39, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5
Offset: 1

Views

Author

Derek Orr, Aug 01 2014

Keywords

Comments

For a(n) > 0, a(n) is a divisor of n.
If a(n) = n, then n - 1 is in A002982.

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,n,s=(k!-n)/k;if(floor(s)==s,if(ispseudoprime(s),return(k))))
    vector(150, n, a(n))

Extensions

Typo in PARI code fixed by Colin Barker, Aug 02 2014