[go: up one dir, main page]

login
A301861
a(n) is the sum of the decimal digits of (n!)!.
2
1, 1, 2, 9, 81, 783, 7164, 69048, 711009, 7961040, 95935761, 1242436185, 17235507996
OFFSET
0,3
COMMENTS
Presumably, lim_{n->oo} a(n)/A008906(n!) = 9/2.
FORMULA
a(n) = A007953(A000197(n)). - Michel Marcus, Mar 28 2018
a(n) = A004152(A000142(n)). - Altug Alkan, Mar 28 2018
EXAMPLE
a(0) = digitsum((0!)!) = digitsum(1!) = digitsum(1) = 1.
a(1) = digitsum((1!)!) = digitsum(1!) = digitsum(1) = 1.
a(2) = digitsum((2!)!) = digitsum(2!) = digitsum(2) = 2.
a(3) = digitsum((3!)!) = digitsum(6!) = digitsum(720) = 7+2 = 9.
a(4) = digitsum((4!)!) = digitsum(24!) = digitsum(620448401733239439360000) = 6+2+0+4+4+8+4+0+1+7+3+3+2+3+9+4+3+9+3+6+0+0+0+0 = 81.
MAPLE
a:= n-> add(i, i=convert(n!!, base, 10)):
seq(a(n), n=0..8); # Alois P. Heinz, Oct 27 2021
MATHEMATICA
Table[Plus@@IntegerDigits[(n!)!], {n, 0, 10}] (* Vincenzo Librandi, Mar 29 2018 *)
PROG
(PARI) a(n) = sumdigits(n!!); \\ Michel Marcus, Mar 28 2018
(Magma) [&+Intseq(Factorial(Factorial(n))): n in [0..10]]; // Vincenzo Librandi, Mar 29 2018
(Python)
from math import factorial
def A301861(n):
return sum(int(d) for d in str(factorial(factorial(n)))) # Chai Wah Wu, Mar 31 2018
# faster program for larger values of n
from gmpy2 import mpz, digits, fac
def A301861(n): return int(sum(mpz(d) for d in digits(fac(fac(n))))) # Chai Wah Wu, Oct 24 2021
CROSSREFS
Cf. A000142 (factorial numbers), A000197 ((n!)!), A004152 (sum of digits of n!), A007953 (sum of digits of n), A008906 (number of digits in n! excluding trailing zeros), A027868 (number of trailing zeros in n!), A034886 (number of digits in n!), A063979 (number of digits in (n!)!).
Sequence in context: A135868 A212271 A147302 * A112670 A117581 A110567
KEYWORD
nonn,base,hard,more
AUTHOR
Jon E. Schoenfield, Mar 28 2018
EXTENSIONS
a(11) from Chai Wah Wu, Mar 31 2018
a(12) from Chai Wah Wu, Apr 01 2018
STATUS
approved