login
A242745
Least k > 0 such that (k!-n!)/(k-n) is an integer.
1
2, 1, 2, 2, 3, 3, 4, 4, 3, 4, 5, 4, 5, 6, 5, 4, 5, 6, 7, 5, 6, 6, 7, 6, 5, 6, 7, 4, 5, 6, 7, 8, 9, 10, 5, 6, 7, 8, 9, 8, 9, 6, 7, 8, 5, 6, 7, 8, 7, 8, 6, 7, 8, 6, 7, 8, 9, 10, 11, 10, 11, 12, 7, 8, 5, 6, 7, 8, 9, 7, 8, 8, 9, 10, 11, 12, 7, 6, 7, 8, 9, 10, 11, 12, 10, 6, 7, 8, 9, 9, 7
OFFSET
1,1
COMMENTS
a(n) <= n for all n > 1.
Further, n-a(n) is a nondecreasing sequence.
Forward differences never exceed 1. - Robert G. Wilson v, Jun 05 2014
a(n) is the least k > 0 such that k!/(n-k) is an integer. Proof: note that it is correct for n < 4. If n >= 4, then a(n) < n - 1 since (n! - (n-2)!)/2 is an integer. n! - k! = k!*(n!/k! - 1) is divisible by n - k and n!/k! - 1 can never be divisible by n - k, where k < n - 1. Therefore, k! is divisible by n - k. - Jinyuan Wang, Mar 13 2020
LINKS
EXAMPLE
(5!-1!)/(5-1) = 119/4 is not an integer. (5!-2!)/(5-2) = 118/3 is not an integer. (5!-3!)/(5-3) = 114/2 = 57 is an integer. Thus a(5) = 3.
MATHEMATICA
f[n_] := Block[{k = 1}, While[ Mod[k! - n!, k - n] != 0, k++]; k]; f[1] = 2; Array[f, 91] (* Robert G. Wilson v, Jun 05 2014 *)
PROG
(PARI) a(n)= if(n==1, 2, for(k=1, oo, if(k!%(k-n)==0, return(k)))); \\ Modified by Jinyuan Wang, Mar 13 2020
CROSSREFS
Sequence in context: A285870 A224931 A029195 * A285578 A029168 A035454
KEYWORD
nonn
AUTHOR
Derek Orr, May 21 2014
STATUS
approved