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-2 of 2 results.

A356757 Omit zero digits from factorial numbers.

Original entry on oeis.org

1, 1, 2, 6, 24, 12, 72, 54, 432, 36288, 36288, 399168, 47916, 622728, 871782912, 137674368, 2922789888, 35568742896, 64237375728, 121645148832, 243292817664, 5199421717944, 11247277776768, 258521673888497664, 624484173323943936, 15511214333985984, 4329146112665635584
Offset: 0

Views

Author

Stefano Spezia, Aug 26 2022

Keywords

Examples

			a(12) = 47916 since 12! = 479001600.
		

Crossrefs

Cf. A027869 (number of omitted zero digits), A356758 (number of nonzero digits).

Programs

  • Mathematica
    Table[FromDigits[Select[IntegerDigits[n!],Positive]], {n,0,26}]
  • PARI
    a(n) = fromdigits(select(x->(x>0), digits(n!))); \\ Michel Marcus, Aug 26 2022
    
  • Python
    from math import factorial
    def a(n): return int(str(factorial(n)).replace("0", ""))
    print([a(n) for n in range(27)]) # Michael S. Branicky, Aug 26 2022

Formula

a(n) = A004719(A000142(n)).

A375348 a(n) is the mode of the digits of n! not counting trailing zeros (using -1 if multimodal).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Inspired by A356758.
If we were to count trailing zeros, then would have a(n) = 0 for all n >= 34. Therefore we only consider the decimal digits of A004154(n).
Conjecture: excluding -1, as n -> oo, all digits occur equally often.

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 only two digits appearing with the same frequency, 2 and 4.
a(14) = -1 because 14! = 87178291200 and, not counting the two trailing 0's, there are two 1's, two 2's, two 7's, and two 8's.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[Length[c=Commonest[IntegerDigits[n! / 10^IntegerExponent[n!]]]] > 1, -1, c[[1]]]; Array[a, 86, 0]
  • Python
    from collections import Counter
    from sympy import factorial
    def A375348(n): return -1 if len(k:=Counter(str(factorial(n)).rstrip('0')).most_common(2)) > 1 and k[0][1]==k[1][1] else int(k[0][0]) # Chai Wah Wu, Sep 15 2024
Showing 1-2 of 2 results.