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.

A242567 Least number k >= 0 such that (n!+k)/(n+k) is an integer.

Original entry on oeis.org

1, 1, 0, 1, 18, 1, 712, 5031, 14, 1, 18, 1, 479001586, 1719, 87178291184, 1, 3024, 1, 40, 633, 124748, 1, 86, 51847, 625793187628, 123, 20404, 1, 210, 1, 265252859812191058636308479999968, 755, 263130836933693530167218012159999966
Offset: 1

Views

Author

Derek Orr, May 17 2014

Keywords

Comments

a(n) = 1 iff n+1 is prime.
For n > 2, in order for (n!+k)/(n+k) to be an integer, the smallest integer possible is 2. Thus, a(n) <= n!-2n for all n > 2.
Let q = (n!+k)/(n+k). Then, k = (n!-n)/(q-1)-n. So, a(n) = d-n, where d is the smallest divisor (> n) of n!-n. (for all n >= 4) - Hiroaki Yamanouchi, Sep 29 2014

Examples

			(6!+1)/(6+1) = 103 is an integer. Thus a(6) = 1.
		

Crossrefs

Cf. A006093.

Programs

  • PARI
    a(n)=for(k=1,10^5,s=(n!+k)/(n+k);if(floor(s)==s,return(k)));
    n=1;while(n<100,print(a(n));n+=1)

Extensions

a(13), a(15), a(21), a(25), a(31) and a(33) from Hiroaki Yamanouchi, Sep 29 2014