cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 31-40 of 46 results. Next

A228311 Numbers k such that the sum of digits of k! is itself a factorial.

Original entry on oeis.org

0, 1, 2, 3, 4, 21966, 176755, 182624820
Offset: 1

Views

Author

Keywords

Comments

The sum of digits of k! is approximately (9/2)*(d-z), where d=A034886(k) is the number of digits of k!, which is about (log(k/E)*k + log(2*k*Pi)/2)/log(10), and z=A027868(k) is the number of trailing zeros of k!, which is Sum_{j>=1} floor(k/5^j). - Giovanni Resta, Aug 28 2013
a(9) > 2.235*10^9. - Hans Havermann, May 16 2014
k! has ~ k log_10(k) digits, so its digit sum is typically close to C*k*log_10(k) for some constant C. A random number around j has probability something like log(j)/(j log log(j)) of being a factorial, so the probability that the digit sum of k! is a factorial should be something like const/(k log log k). The sum of this diverges, so we should expect infinitely many terms in the sequence. - Robert Israel, Aug 08 2014

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

Crossrefs

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

A241730 Number of digits in the decimal expansion of n! minus the number of digits in the decimal expansion of n.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 20, 21, 22, 24, 25, 27, 28, 29, 31, 32, 34, 35, 37, 39, 40, 42, 43, 45, 46, 48, 50, 51, 53, 55, 56, 58, 60, 61, 63, 65, 66, 68, 70, 72, 73, 75, 77, 79, 80, 82, 84, 86, 88, 89, 91, 93, 95, 97, 99, 100, 102, 104, 106
Offset: 0

Views

Author

Alonso del Arte, Apr 27 2014

Keywords

Examples

			a(5) = 2 because 5! = 120 has three digits, 5 has only one digit, and 3 - 1 = 2.
a(6) = 2 because 6! = 720 has three digits, 6 has only one digit, and 3 - 1 = 2.
a(7) = 3 because 7! = 5040 has four digits, 7 has only one digit, and 4 - 1 = 3.
		

Crossrefs

Programs

  • Maple
    seq(nops(convert(n!,base,10)) - nops(convert(n,base,10)), n=0..50); # Peter Luschny, Apr 28 2014
  • Mathematica
    Table[Length[IntegerDigits[n!]] - Length[IntegerDigits[n]], {n, 0, 79}]
  • PARI
    a(n)=lngamma(n+1)\log(10)-#Str(n)+1 \\ Charles R Greathouse IV, Apr 28 2014

Formula

a(n) = floor(log(n!)/log(10)) - floor(log(n)/log(10)) for n > 0.
a(n) = A034886(n) - A055642(n).

A333598 Numbers m such that m! has a palindromic number of decimal digits.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 22, 30, 37, 44, 57, 63, 69, 70, 81, 86, 91, 106, 111, 116, 126, 131, 140, 145, 154, 163, 168, 177, 186, 199, 221, 225, 238, 242, 255, 259, 288, 292, 368, 372, 384, 388, 407, 411, 419, 423, 438, 450, 532
Offset: 1

Views

Author

Bernard Schott, Mar 28 2020

Keywords

Comments

The corresponding palindromic numbers are 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 77, 88, 99, 101, ...
Nice result: 22 is a palindrome and 22! has 22 digits, and also, 44! has 55 digits.

Examples

			14! = 87178291200 that has 11 digits, 11 is a palindrome, hence 14 is a term.
		

Crossrefs

Cf. A006488 (similar, with square), A035065 (similar, with prime), A056851 (similar, with cube), A333431 (similar, with factorial).

Programs

  • Mathematica
    Select[Range[0, 532], PalindromeQ @ Length @ IntegerDigits[#!] &] (* Amiram Eldar, Mar 28 2020 *)
    Select[Range[0,550],PalindromeQ[IntegerLength[#!]]&] (* Harvey P. Dale, Oct 30 2023 *)
  • PARI
    isok(m) = my(d=digits(#Str(m!))); d == Vecrev(d); \\ Michel Marcus, Mar 28 2020

A375575 a(n) is the least frequent digit of n! not counting trailing zeros, or -1 if there is more than one least frequent digit.

Original entry on oeis.org

1, 1, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, -1, -1, 7, 0, 4, -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, 8, -1, -1, 9, -1, -1, 0, 9, 9, -1, -1, -1, 1, -1, -1, 2, -1, -1, 5, 5, 1, 4, 5, 7, -1, 5, -1, 6, 6, 0, -1, 5, 9, 6, -1, 0, 5, 9
Offset: 0

Views

Author

Keywords

Comments

Analogous to A375348.
If we were to count trailing zeros, then a(n) would never equal zero, for all n's >= 0. Therefore we only consider the decimal digits of A004154.
Conjecture: excluding -1, as n -> oo, the digits distribution is uniform as in A375348.

Examples

			a(0) = a(1) = 1 because 0! = 1! = 1 and 1 is the only digit present;
a(4) = -1 since 4! = 24 and there are two least frequent digits, 2 and 4.
a(14) = 9 because 14! = 87178291200 and, not counting the two trailing 0's, there are two 1's, two 2's, two 7's, two 8's but only one 9.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,j;
      L:= convert(n!,base,10);
      for j from 1 while L[j] = 0 do od:
      L:= Statistics:-Tally(L[j...-1]);
      L:= sort(L,(a,b) -> rhs(a) < rhs(b));
      if nops(L) >= 2 and rhs(L[2]) = rhs(L[1]) then -1 else lhs(L[1]) fi
    end proc:
    map(f, [$0..100]); # Robert Israel, Sep 02 2024
  • Mathematica
    Rarest[lst_] := MinimalBy[ Tally[lst], Last][[All, 1]]; a[n_] := If[ Length[c = Rarest[ IntegerDigits[n!/10^IntegerExponent[n!, 10]] ]] >1, -1, c[[1]]]; Array[a, 80, 0]
  • Python
    from collections import Counter
    from sympy import factorial
    def A375575(n): return -1 if len(k:=Counter(str(factorial(n)).rstrip('0')).most_common()) > 1 and k[-1][1]==k[-2][1] else int(k[-1][0]) # Chai Wah Wu, Sep 15 2024

A381040 Numbers k such that the concatenation of 1, k! and 1 is prime.

Original entry on oeis.org

7, 9, 10, 15, 21225
Offset: 1

Views

Author

Michael S. Branicky, Apr 14 2025

Keywords

Comments

Also, numbers k such that 10^(A034886(k)+1) + 10k! + 1 is prime.
For k >= 5, the foregoing requires that 10^(A034886(k)+1) + 1 has no prime factors <= k.
a(6) > 10^5. - Michael S. Branicky, Apr 24 2025

Examples

			The concatenation of 1, 7! and 1 is 150401, which is prime, so 7 is a term.
		

Crossrefs

Corresponding primes are in A262195.

A073279 Number of digits of n!^n! (ultrafactorial numbers).

Original entry on oeis.org

1, 1, 1, 5, 34, 250, 2058, 18661, 185695, 2017527, 23804069, 303413813, 4157895295, 60989187252, 953766105164, 15844435971349, 278704524938621, 5175632136205088, 101198102131888304, 2078318050691940125, 44731639502987747576, 1006917859088311808499
Offset: 0

Views

Author

Rick L. Shepherd, Jul 23 2002

Keywords

Crossrefs

Cf. A046882 (ultrafactorial numbers), A000142 (n!), A034886 (digits of n!).

Programs

  • Mathematica
    Table[1 + Floor[n!*Log10[n!]], {n, 0, 21}] (* Arkadiusz Wesolowski, Oct 13 2012 *)
  • PARI
    for(n=0,8,print1(length(Str(n!^n!)),","))

Formula

a(n) = floor(log(n!^n!)/log(10)) + 1.

Extensions

More terms from Arkadiusz Wesolowski, Jul 04 2012
Terms a(17) to a(21) corrected by Arkadiusz Wesolowski, Oct 13 2012

A094873 n! has a triangular number of digits.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 9, 13, 17, 32, 38, 44, 65, 106, 125, 135, 156, 178, 201, 213, 278, 292, 306, 335, 350, 381, 413, 446, 463, 480, 570, 589, 608, 647, 667, 687, 728, 749, 770, 880, 996, 1020, 1044, 1169, 1247, 1300, 1327, 1354, 1437, 1551, 1669, 1699, 1760
Offset: 0

Views

Author

Jason Earls, Jun 16 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[0,1800],OddQ[Sqrt[1+8 IntegerLength[#!]]]&] (* Harvey P. Dale, Aug 07 2023 *)

Formula

{n: A034886(n) in A000217}. - R. J. Mathar, Nov 15 2019

A125059 Number of digits in n!!.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57
Offset: 0

Views

Author

Keywords

Examples

			a(5) = 2 because 5!! = 5*3*1 = 15.
		

Crossrefs

Programs

  • Maple
    a:= n-> length(doublefactorial(n)):
    seq(a(n), n=0..76);  # Alois P. Heinz, Sep 28 2023
  • Mathematica
    IntegerLength[Range[80]!!] (* Harvey P. Dale, Mar 23 2018 *)

Formula

a(n) = A055642(A006882(n)).

Extensions

a(0)=1 prepended by Georg Fischer, Sep 28 2023

A135424 a(n) = n!^number of decimal digits of n!.

Original entry on oeis.org

1, 1, 2, 6, 576, 1728000, 373248000, 645241282560000, 106562062388507443200000, 2283380023591730815784976384000000, 8285929429609672784320522302259200000000000000, 6445338699818543423838070745146350567696629760000000000000000
Offset: 0

Views

Author

Giovanni Teofilatto, Dec 12 2007

Keywords

Crossrefs

Cf. A034886.

Programs

  • Mathematica
    #^IntegerLength[#]&/@(Range[0,10]!) (* Harvey P. Dale, Feb 11 2015 *)

Extensions

Offset corrected by R. J. Mathar, Apr 22 2010
More terms from Harvey P. Dale, Feb 11 2015

A176786 Last nonzero digit of A000043(n)!.

Original entry on oeis.org

6, 4, 8, 6, 8, 6, 6, 8, 2, 6, 4, 4, 8, 8, 6, 2, 4, 2, 2, 2, 8, 2, 6, 2, 4, 4, 8, 6, 4, 2, 8, 6, 2, 6, 2, 8, 2, 6, 2, 8, 4, 6, 2, 8, 8, 8, 2, 8
Offset: 1

Views

Author

Washington Bomfim, Dec 07 2010

Keywords

Comments

The C program, from first link, is based on a new method, see second link. It was developed from a congruence found in the first reference "Concrete Mathematics". The function D() of this program implements the simple division algorithm found in "D. E. Knuth, The Art of Computer Programming, V.2." (second reference). Another approach can be to use Dresden's formula that can be found from the third link. One can use the function LastDigit() of the mentioned program to find the last nonzero digit of N! for very large values of N. The factorial of the 47th (known) Mersenne prime has approximately 10^12,978,195 digits.
Many other algorithms for the general problem of finding the last nonzero digit of a factorial are given in A008904. [D. S. McNeil, Dec 10 2010]

Examples

			a(1) = 6 since the first Mersenne prime is 3, and 3! = 6.
		

References

  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Math.; Addison-Wesley, section 4, exercises 40, and 54.
  • D. E. Knuth, The Art of Computer Programming, vol.2, section 4.3.1, exercise 16.

Crossrefs

Formula

a(n) = A008904(2^A000043(n)-1) = A008904(A000668(n)).

Extensions

Terms for n <= 40 confirmed by D. S. McNeil, Dec 08 2010
a(41)-a(47) from Max Alekseyev, Jan 31 2012, Mar 16 2015, Dec 01 2019
a(48) from Chai Wah Wu, Dec 07 2023
Previous Showing 31-40 of 46 results. Next