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
Jinyuan Wang, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn
AUTHOR
Derek Orr, May 21 2014
STATUS
approved