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.

Showing 1-10 of 13 results. Next

A034886 Number of digits in n!.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18, 19, 20, 22, 23, 24, 26, 27, 29, 30, 31, 33, 34, 36, 37, 39, 41, 42, 44, 45, 47, 48, 50, 52, 53, 55, 57, 58, 60, 62, 63, 65, 67, 68, 70, 72, 74, 75, 77, 79, 81, 82, 84, 86, 88, 90, 91, 93, 95, 97, 99, 101, 102
Offset: 0

Views

Author

Keywords

Comments

Most counterexamples to the Kamenetsky formula (see below) must belong to A177901.
Noam D. Elkies reported on MathOverflow (see link):
"A counterexample [to Kamenetsky's formula] is n_1 := 6561101970383, with log_10((n_1/e)^n_1*sqrt(2*Pi*n_1)) = 81244041273652.999999999999995102482, but log_10(n_1!) = 81244041273653.000000000000000618508. [...] n_1 is the first counterexample, and the only one up to 10^14."
From Bernard Schott, Dec 07 2019: (Start)
a(n) < n iff 2 <= n <= 21;
a(n) = n iff n = 1, 22, 23, 24;
a(n) > n iff n = 0 or n >= 25. (End)

References

  • Martin Gardner, "Factorial Oddities." Ch. 4 in Mathematical Magic Show: More Puzzles, Games, Diversions, Illusions and Other Mathematical Sleight-of-Mind from Scientific American. New York: Vintage, pp. 50-65, 1978

Crossrefs

Cf. A006488 (a(n) is a square), A056851 (a(n) is a cube), A035065 (a(n) is a prime), A333431 (a(n) is a factorial), A333598 (a(n) is a palindrome), A067367 (p and a(p) are primes), A058814 (n divides a(n)).
Cf. A137580 (number of distinct digits in n!), A027868 (number of trailing zeros in n!).

Programs

  • Haskell
    a034886 = a055642 . a000142  -- Reinhard Zumkeller, Apr 08 2012
    
  • Magma
    [Floor(Log(Factorial(n))/Log(10)) + 1: n in [0..30]]; // G. C. Greubel, Feb 26 2018
  • Maple
    A034886 := n -> `if`(n<2,1,`if`(n<6561101970383, ceil((ln(2*Pi)-2*n+ln(n)*(1+2*n))/(2*ln(10))),length(n!))); # Peter Luschny, Aug 26 2011
  • Mathematica
    Join[{1, 1}, Table[Ceiling[Log[10, 2 Pi n]/2 + n*Log[10, n/E]], {n, 2, 71}]]
    f[n_] := Floor[(Log[2Pi] - 2n + Log[n]*(1 + 2n))/(2Log[10])] + 1; f[0] = f[1] = 1; Array[f, 72, 0] (* Robert G. Wilson v, Jan 09 2013 *)
    IntegerLength/@(Range[0,80]!) (* Harvey P. Dale, Aug 07 2022 *)
  • PARI
    for(n=0,30, print1(floor(log(n!)/log(10)) + 1, ", ")) \\ G. C. Greubel, Feb 26 2018
    

Formula

a(n) = floor(log(n!)/log(10)) + 1.
a(n) = A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n); a(n) = A055642(A000142(n)). - Reinhard Zumkeller, Jan 27 2008
Using Stirling's formula we can derive an approximation, which is very fast to compute in practice: ceiling(log_10(2*Pi*n)/2 + n*(log_10(n/e))). This approximation gives the exact answer for 2 <= n <= 5*10^7. - Dmitry Kamenetsky, Jul 07 2008
a(n) = ceiling(log_10(1) + log_10(2) + ... + log_10(n)). - Dmitry Kamenetsky, Nov 05 2010

Extensions

Explained that the formula is an approximation. Made the formula easier to read. - Dmitry Kamenetsky, Dec 15 2010

A027869 Number of 0's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 2, 2, 4, 4, 2, 4, 4, 4, 5, 6, 7, 7, 8, 5, 6, 9, 8, 9, 10, 7, 9, 7, 10, 8, 11, 9, 10, 12, 16, 12, 9, 15, 13, 13, 12, 13, 16, 11, 14, 14, 19, 18, 18, 17, 18, 18, 17, 20, 17, 19, 19, 26, 20, 21, 20, 20, 23, 22, 25, 21, 20, 25, 23, 35
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Count[IntegerDigits[n!], 0], {n, 0, 100}] (* T. D. Noe, Apr 10 2012 *)
    DigitCount[Range[0,80]!,10,0] (* Harvey P. Dale, Jul 08 2020 *)
  • PARI
    a(n)=my(d=digits(n!)); sum(i=1,#d,d[i]==0) \\ Charles R Greathouse IV, Jul 06 2017
    
  • Python
    from math import factorial
    def a(n): return str(factorial(n)).count('0')
    print([a(n) for n in range(74)]) # Michael S. Branicky, Jan 11 2022

Formula

a(n) = A034886(n) - (A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008
A027868(n) <= a(n). - Reinhard Zumkeller, Jan 27 2008
Conjecture: a(n) ~ (9*A027868(n) + A034886(n))/10. This formula is based on the assumption that the digits other than trailing zeros are uniformly randomly distributed. - Nicolas Bělohoubek, Jan 11 2022

A079692 Number of 7's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 3, 0, 1, 2, 6, 2, 1, 0, 0, 1, 1, 3, 0, 4, 1, 1, 2, 2, 4, 3, 4, 4, 4, 3, 3, 4, 4, 4, 1, 2, 8, 5, 5, 3, 8, 5, 7, 4, 9, 4, 4, 7, 7, 6, 8, 8, 3, 9, 8, 6, 8, 8, 9, 10, 12, 7, 7, 9, 9, 7, 10, 10, 9, 14, 11, 12, 9, 7, 13, 17, 2, 11, 12, 19, 15, 12, 10, 15, 15, 16, 19, 7, 7, 12
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> numboccur(7, convert(n!, base, 10)):
    seq(a(n), n=0..101);  # Alois P. Heinz, Apr 26 2021
  • PARI
    a(n) = #select(x->(x==7), digits(n!)); \\ Michel Marcus, Apr 26 2021

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

Extensions

a(78)-a(79) corrected by Georg Fischer, Apr 26 2021

A137579 Frequency of occurrence of the least frequent digits of decimal representation of n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 2, 1, 2, 2, 0, 2, 3, 0, 3, 2, 2, 3, 1, 2, 3, 2, 2, 3, 3, 2, 3, 4, 1, 4, 4, 5, 3, 3, 4, 4, 3, 5, 3, 6, 6, 4, 5, 5, 3, 5, 5, 7, 7, 6, 6, 4, 5, 8, 1, 8, 8, 5, 8, 7, 2, 6, 10, 6, 7, 7, 7, 8, 7, 11, 6, 7, 7
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 27 2008

Keywords

Comments

a(n)=Min{A027869(n),A079680(n),A079714(n),A079684(n),A079688(n),A079690(n),A079691(n),A079692(n),A079693(n),A079694(n)}.
a(n) = 0 iff A137580(n) < 10.

Crossrefs

Programs

  • Mathematica
    Table[Min[DigitCount[n!]],{n,0,110}] (* Harvey P. Dale, Aug 21 2012 *)

A079680 Number of 1's in n!.

Original entry on oeis.org

1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 0, 3, 1, 3, 2, 1, 1, 4, 3, 3, 4, 4, 3, 2, 5, 7, 2, 4, 4, 4, 7, 3, 6, 6, 6, 4, 6, 7, 4, 10, 4, 5, 7, 10, 3, 2, 5, 5, 4, 7, 10, 6, 8, 3, 8, 9, 12, 5, 5, 8, 11, 9, 7, 6, 6, 16, 13, 9, 7, 7, 11, 15, 8, 9, 13, 10, 15, 13, 8, 14, 14, 12, 11, 12, 13, 16, 11
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Formula

a(n) = A034886(n) - (A027869(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

A079688 Number of 4's in n!.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 2, 2, 3, 1, 2, 4, 2, 3, 2, 4, 3, 1, 1, 0, 3, 4, 3, 3, 3, 3, 3, 4, 3, 6, 2, 5, 4, 3, 3, 4, 3, 7, 3, 5, 7, 6, 6, 13, 8, 8, 7, 10, 4, 4, 8, 10, 8, 16, 10, 7, 13, 6, 5, 10, 7, 7, 13, 11, 11, 10, 4, 13, 13, 16, 10, 8, 15, 14, 10, 18, 6, 13, 12, 17, 12
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Mathematica
    DigitCount[#,10,4]&/@(Range[0,100]!) (* Harvey P. Dale, Jul 30 2015 *)

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

A079690 Number of 5's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 1, 0, 2, 0, 3, 3, 2, 2, 2, 4, 3, 1, 2, 2, 2, 2, 5, 1, 2, 5, 6, 5, 7, 5, 5, 8, 5, 6, 5, 2, 4, 7, 3, 3, 11, 5, 6, 5, 5, 3, 7, 6, 4, 7, 10, 3, 7, 8, 5, 10, 7, 3, 7, 13, 9, 10, 6, 9, 7, 14, 13, 1, 12, 8, 13, 13, 11, 10, 10, 12, 17, 17, 14, 15, 12
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Mathematica
    DigitCount[#,10,5]&/@(Range[0,100]!) (* Harvey P. Dale, Sep 17 2016 *)

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079691(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

A079691 Number of 6's in n!.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 2, 0, 2, 1, 1, 2, 0, 2, 3, 2, 0, 4, 3, 2, 3, 3, 2, 5, 3, 4, 7, 2, 3, 5, 2, 3, 6, 5, 6, 5, 8, 4, 7, 6, 6, 9, 5, 8, 7, 3, 9, 6, 7, 4, 6, 8, 6, 6, 11, 6, 8, 8, 11, 6, 4, 11, 11, 10, 6, 5, 9, 8, 9, 8, 11, 10, 8, 11, 12, 13, 9, 11, 7, 12, 15, 15, 17, 8, 11, 16, 11
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DigitCount[n!,10,6],{n,0,100}] (* Harvey P. Dale, Aug 08 2023 *)

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079692(n) + A079693(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

A079693 Number of 8's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 0, 1, 2, 1, 4, 2, 1, 2, 1, 0, 1, 4, 1, 2, 1, 6, 4, 2, 5, 6, 2, 8, 2, 1, 3, 2, 0, 7, 4, 2, 4, 2, 9, 3, 7, 4, 4, 7, 5, 5, 9, 8, 9, 4, 11, 7, 10, 9, 4, 11, 7, 7, 12, 7, 9, 9, 7, 8, 14, 18, 15, 9, 9, 10, 8, 18, 12, 14, 13, 8, 10, 8, 12, 5, 8, 8, 18, 10, 14, 9, 11, 12, 16
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[DigitCount[n!,10,8],{n,0,100}] (* Harvey P. Dale, May 06 2016 *)

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079694(n)). - Reinhard Zumkeller, Jan 27 2008

A079694 Number of 9's in n!.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 1, 0, 2, 1, 0, 0, 1, 3, 0, 1, 2, 2, 1, 1, 0, 4, 2, 1, 2, 2, 5, 3, 7, 4, 1, 5, 5, 0, 4, 2, 2, 4, 6, 7, 3, 2, 2, 3, 3, 6, 4, 6, 6, 5, 6, 8, 6, 7, 6, 7, 5, 6, 6, 8, 8, 7, 12, 5, 7, 5, 7, 10, 12, 7, 6, 9, 5, 12, 13, 12, 10, 9, 9, 10, 13, 18, 14, 12, 7, 7, 7, 15, 20, 16
Offset: 0

Views

Author

Cino Hilliard, Jan 31 2003

Keywords

Crossrefs

Programs

  • Mathematica
    DigitCount[#,10,9]&/@(Range[0,100]!) (* Harvey P. Dale, Dec 12 2013 *)

Formula

a(n) = A034886(n) - (A027869(n) + A079680(n) + A079714(n) + A079684(n) + A079688(n) + A079690(n) + A079691(n) + A079692(n) + A079693(n)). - Reinhard Zumkeller, Jan 27 2008
Showing 1-10 of 13 results. Next