OFFSET
1,2
COMMENTS
a(10) = 720, so 10 is a number k such that a(k) is neither k! nor k. Is 10 the only such number?
FORMULA
a(n) <= n!; a(m!) = m!.
EXAMPLE
a(10) = 10*9*8 = 720.
a(6) = 6.
MAPLE
isfact := proc(n) local i ; for i from 1 do if i! = n then RETURN(true) ; elif i! > n then RETURN(false) ; fi ; od; end: A110808 := proc(n) local k, nfall ; for k from 0 do nfall := mul(n-i, i=0..k) ; if isfact(nfall) then RETURN(nfall) ; fi ; od: end: seq(A110808(n), n=1..40) ; # R. J. Mathar, Feb 08 2008
MATHEMATICA
isfact[n_] := Module[{i}, For[i = 1, True, i++, If[i! == n, Return[True], If[i! > n, Return[False]]]]];
a[n_] := Module[{k, nfall}, For[k = 0, True, k++, nfall = Product[n - i, {i, 0, k}]; If[isfact[nfall], Return[nfall]]]];
Table[a[n], {n, 1, 20}] (* Jean-François Alcover, May 20 2024, after R. J. Mathar *)
PROG
(PARI) isf(p) = my(f=1); for(k=1, oo, f *= k; if (f==p, return(1)); if (f>p, return(0)); );
a(n) = my(p=n); for (k=1, n, if (isf(p), return(p)); p *= (n-k); ); \\ Michel Marcus, May 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 14 2005
EXTENSIONS
More terms from R. J. Mathar, Feb 08 2008
More terms from Michel Marcus, May 20 2024
STATUS
approved