A228311 Numbers k such that the sum of digits of k! is itself a factorial.
0, 1, 2, 3, 4, 21966, 176755, 182624820
Offset: 1
Examples
The sum of the digits of 21966! is 362880 = 9!. The sum of the digits of 176755! is 3628800 = 10!. The sum of the digits of 182624820! is 6227020800 = 13!.
Links
- Shyam Sunder Gupta, Fascinating Factorials, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 16, 411-442.
- "Mouhaha" Digit sums and factorials
Programs
-
Mathematica
lst = {0}; k = p = 1; fctl = Range@ 15!; While[k < 180000, p = p*k; While[ Mod[p, 10] == 0, p /= 10]; If[ MemberQ[ fctl, Plus @@ IntegerDigits@ p], Print[k]; AppendTo[lst, k]]; k++]; lst (* Robert G. Wilson v, Feb 18 2014 *) With[{fcts=Range[20]!},Select[Range[0,22000],MemberQ[fcts,Total[IntegerDigits[#!]]]&]] (* Harvey P. Dale, Jan 06 2024 *)
-
PARI
lpf(n)=my(f=factor(n)[,1]); f[1] factorial_lval(n, p)={ my(s); while(n\=p, s+=n); s }; isfactorial(n)={ if(n<3, return(n>0)); my(v2=valuation(n,2),mn=v2+1,mx=mn+log(v2+1.5)\log(2),t,c); while (mx - mn > 1, t = mn + (mx - mn)\2; c = factorial_lval(t, 2); if (c < v2, mn = t+1 , if (c > v2, mx = t-1 , mx = bitor(t,1); mn = max(mn, mx-1) ) ) ); if (mn < mx, my(p=lpf(mx)); t = valuation(n, p); c = factorial_lval(mx, p); if (t > c,return(0)); if (t == c, mn = mx ) ); n==mn! }; is(n)=isfactorial(sumdigits(n!))
Extensions
a(8) from Hans Havermann, Mar 24 2014
Comments