A242707 Least number k > 2 such that (k!+n)/(k+n) is an integer, or 0 if no such k exists.
4, 0, 0, 0, 12, 4, 5032, 6, 2990, 329881, 6, 10, 1720, 9, 6, 4, 56, 5, 634, 18, 68, 12, 51848, 22, 124, 1671, 12, 6, 30, 28, 756, 30
Offset: 1
Examples
(3!+1)/(3+1) = 7/4 is not an integer. (4!+1)/(4+1) = 25/5 = 5 is an integer. So a(1) = 4. a(2) = 0, because k+2 can never divide k!+2: If k+2 = p > 3 is a prime, then k!+2 = (p-2)!+2 == (1+2) (mod p), using the fact that (p-2)! == 1 (mod p) for all primes p. If k+2 > 4 is composite, let k+2 = p*m for some prime p and some m > 2. Then p*m-2 >= m and also p*m-2 > p. Thus, k! = (p*m-2)! is divisible by p*m. (If m = p this still holds because then p*m-2 >= 2*m.) Therefore, k!+2 == 2 (mod k+2) in this case. a(3) = 0 for similar reasons: Consider s = (k!+3) mod (k+3). If k+3 is prime, s = (k+8)/2 and if k+3 is composite, s = 3. So s is never 0. a(4) = 0 as well: Let s = (k!+4) mod (k+4). If k+4 is prime, there are two cases. If k == 1 (mod 6), then s = (k+29)/6. If k == 3 (mod 6), then s = (5*k+45)/6 except at the following finite number of points (k,s): (3,3), (9,2), and (15,1). If k+4 is composite, s = 4 except at (k,s) = (5,7). Thus, s is never 0. - _Jon E. Schoenfield_, Oct 28 2014
Programs
-
PARI
a(n)=k=3;while((k!+n)%(k+n)&&k<2e6,k++);k \\ program improved by Derek Orr, Oct 23 2014
-
PARI
a(n)=for(k=3,n,if((k!+n)%(k+n)==0,return(k))); forprime(kn=2*n,2e6+n, if(prod(i=2,kn-n,i,Mod(1,kn))==-n, return(kn-n))); 0 \\ Charles R Greathouse IV, Oct 28 2014
Extensions
More terms added by Derek Orr, Oct 23 2014 and Jon E. Schoenfield, Oct 25 2014
Edited by M. F. Hasler, Oct 30 2014
Comments