login
This site is supported by donations to The OEIS Foundation.

 

Logo

"Email this user" was broken Aug 14 to 9am Aug 16. If you sent someone a message in this period, please send it again.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228311 Numbers n such that the sum of digits of n! is itself a factorial. 1
0, 1, 2, 3, 4, 21966, 176755, 182624820 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

The sum of digits of n! is approx. equal to sf(n) = (9/2)*(nd-nz), where nd=A034886(n) is the number of digits of n!, which is about (log(n/E)*n + log(2*n*Pi)/2)/log(10), and nz=A027868(n) is the number of trailing zeros of n!, which is sum(k = 1, 2, ..) floor(n/5^k). - Giovanni Resta, Aug 28 2013

a(9) > 2.235*10^9 - Hans Havermann, May 16 2014

21966 = 666 in base 60. - Jon Perry, Aug 07 2014

Also the sum of digits of 21966 is a factorial (along with 1 and 2). - Jon Perry, Aug 12 2014

n! has ~ n log_10(n) digits, so its digit sum is typically close to C*n*log_10(n) for some constant C. A random number around k has probability something like log(k)/(k log log(k)) of being a factorial, so the probability that the digit sum of n! is a factorial should be something like const/(n log log n). The sum of this diverges, so we should expect infinitely many terms in the sequence. - Robert Israel, Aug 08 2014

LINKS

Table of n, a(n) for n=1..8.

"Mouhaha" Digit sums and factorials

EXAMPLE

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!.

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 *)

PROG

(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!))

CROSSREFS

Cf. A229024, A004152.

Sequence in context: A062929 A038105 A143716 * A258107 A107656 A024595

Adjacent sequences:  A228308 A228309 A228310 * A228312 A228313 A228314

KEYWORD

nonn,base,hard,nice

AUTHOR

Charles R Greathouse IV, Aug 27 2013

EXTENSIONS

a(8) from Hans Havermann, Mar 24 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified August 17 03:46 EDT 2017. Contains 290631 sequences.