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

A031145 Factorials with a record number of zeros.

Original entry on oeis.org

1, 120, 5040, 479001600, 6402373705728000, 121645100408832000, 2432902008176640000, 1124000727777607680000, 15511210043330985984000000, 304888344611713860501504000000
Offset: 0

Views

Author

Keywords

Examples

			From _Alonso del Arte_, May 19 2017: (Start)
Note that 5040 has two zeros, even though only one of them is a trailing zero.
Although 3628800 has one more zero than 362880, it still has as many zeros as 5040, and for that reason it is not in this sequence.
Thus the next term after 5040 is 479001600, which has four zeros. (End)
		

Crossrefs

Cf. A031144 (indices of factorials), A027868.

Programs

  • Mathematica
    Function[s, Map[Position[s, #][[1, 1]] &, Union@ FoldList[Max, s]]! ]@ Table[DigitCount[n!, 10, 0], {n, 28}] (* Michael De Vlieger, May 20 2017 *)
    DeleteDuplicates[Table[{n!,DigitCount[n!,10,0]},{n,50}],GreaterEqual[#1[[2]],#2[[2]]]&][[;;,1]] (* Harvey P. Dale, Dec 03 2023 *)

Extensions

More terms from Erich Friedman.
Name clarified by Alonso del Arte, May 19 2017

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

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
Showing 1-3 of 3 results.